Closed asm89 closed 7 years ago
I agree. I believe ConnectionInterface
originally had one of getOption()
or getData()
and the other was added later, and this issue is an artifact from before that change was made.
@asm89 Would you mind submitting a PR with this change, ideally also updating tests if needed (which I would think would be)?
@elazar I would, but it might take a while as I have to get permission from my employer to contribute code. If anyone else is up for it in the meantime please take it. 👍
According to the documentation (and code) the
connect.after.each
callback should return the connection and the write stream belonging to it. The write stream seems to always benull
. I'm pretty certain that it is a bug in the library. On this linegetOption()
gets called on the connection: https://github.com/phergie/phergie-irc-client-react/blob/e76dcfa1a6f85d324f6ecf509cffc1be311e3b39/src/Client.php#L634. I think it should begetData('write')
. It gets set here: https://github.com/phergie/phergie-irc-client-react/blob/e76dcfa1a6f85d324f6ecf509cffc1be311e3b39/src/Client.php#L650.Calling
$connection->getData('write')
in my callback seems to yield the write stream like expected. :)