Conversation
There was a problem hiding this comment.
the visibility is missing, and you need to add an empty line between the attributes and the constructor
|
And indeed, as mentioned in the commit message, tests are needed before merging |
|
@stof thanks for your comments, i've update the code, but got a question about test... to be able to test all functions in this handler, i need to substitute AMQP classes, with mock objects... can you suggest the best way to test it? cuz i don't like to substitute classes in run-time using runkit.. |
There was a problem hiding this comment.
the visibility is still missing
|
@pomaxa a solution could be to inject the dependencies instead of creating them in the object. This way, you will be able to replace the deps easily. |
There was a problem hiding this comment.
typehint the argument instead of doing the check here
|
@andrewtch - thanks, I've just test it and it works. @stof , i've made changes you suggest |
There was a problem hiding this comment.
I'm not too familiar with AMQP, but shouldn't the issuer be the composer channel that's in $record['channel']? I guess it depends if that's just used for information or if it's a machine-level setting.
There was a problem hiding this comment.
@Seldaek It's used for information, just to create a routing key for rabbitmq(or over MQ server, i use it for rabbitmq), to easier manage logging messages. I'll check on $record['channel'], maybe it is better to use it.
…ugh handler constructor
|
@Seldaek - thanks, it was my mistake, i forgot about channel param in record; |
There was a problem hiding this comment.
please remove the @return void as `void`` does not make any sense in PHP
There was a problem hiding this comment.
btw, you could use {@inheritdoc} for this method too
There was a problem hiding this comment.
@return void is commonly understood across multiple languages to mean that you're not returning anything. IMO it should stay.
There was a problem hiding this comment.
Agreed to @damianb , http://www.phpdoc.org/docs/latest/for-users/types.html - PHPDocumentor allows null / void @return statement.
But, still, it'll be better to use just @inheritdoc in this particular case.
There was a problem hiding this comment.
returning nothing is the same than returning null in PHP. And anyway, Monolog follwo the Symfony2 CS which say to omit the @return tag when returning nothing
There was a problem hiding this comment.
...and phpdoc's specification has been around far longer than symfony's, and matches that of other, older and more mature languages. return void has its place for understandability.
There was a problem hiding this comment.
phpdoc also allows to omit it: http://www.phpdoc.org/docs/latest/for-users/tags/return.html#description
adding ability to use rabbitmq as handler;