File tree Expand file tree Collapse file tree
src/main/php/io/modelcontextprotocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ Model Context Protocol change log
33
44## ?.?.? / ????-??-??
55
6+ * Fixed ` io.modelcontextprotocol.EventStream ` implementation when
7+ given input stream does not also implement ` lang.Value `
8+ (@thekid )
69* Fixed initialization being rerun on first call when invoking the
710 ` initialize() ` method manually
811 (@thekid )
Original file line number Diff line number Diff line change 33use Traversable ;
44use io \streams \{InputStream , StringReader };
55use text \json \StringInput ;
6+ use util \Objects ;
67
78/** @test io.modelcontextprotocol.unittest.EventStreamTest */
89class EventStream extends Outcome {
@@ -37,10 +38,10 @@ public function value() {
3738 }
3839
3940 /** @return string */
40- public function toString () { return nameof ($ this ).'( ' .$ this ->stream -> toString ( ).') ' ; }
41+ public function toString () { return nameof ($ this ).'( ' .Objects:: stringOf ( $ this ->stream ).') ' ; }
4142
4243 /** @return string */
43- public function hashCode () { return 'S ' .$ this ->stream -> hashCode ( ); }
44+ public function hashCode () { return 'S ' .Objects:: hashOf ( $ this ->stream ); }
4445
4546 /**
4647 * Comparison
@@ -50,7 +51,7 @@ public function hashCode() { return 'S'.$this->stream->hashCode(); }
5051 */
5152 public function compareTo ($ value ) {
5253 return $ value instanceof self
53- ? $ this ->stream -> compareTo ( $ value ->stream )
54+ ? Objects:: compare ( $ this ->stream , $ value ->stream )
5455 : 1
5556 ;
5657 }
You can’t perform that action at this time.
0 commit comments