Closed loicdev closed 5 years ago
Hi, I don't really understand your problem.
Why do you need to type hint this processor with ?bool
?
Could you provide the PHP CS-Fixer error?
Hi, the phpcs's suggestion :
- public function process(Message $message, array $options)
+ public function process(Message $message, array $options): void
because i haven't got return in the method (the ack processor do it by itself)
i go to the method definition in vendor and i saw the return was indeed ?bool
.
I try to ack the message by myself with a return true/false but i can can't reproduce the ack processor behaviour and it failed.
At this moment, i ignore my consumer file temporary to passed the phpcs tests.
For which file does PHPCS makes you this suggestion?
swarrot
(the lib, not the bundle) you should probably change your PHPCS configuration to analyze only files in your src
directory.ProcessorInterface
? If yes, I don't understand why PHPCS suggest you to change your signature as it wouldn't respect the interface anymore.As the complete signature of the process
method in the ProcessorInterface
should be:
public function process(Message $message, array $options): bool;
Don't hesitate to return a boolean in your custom processors. We won't change the interface for now because it will result in a new major release but when we'll do it, you'll be ready. :)
thanks u ;)
And ProcessorInterface in swarrot defines @return bool|null
in phpdoc. So that suggestion would even be wrong.
Hi, we are using a PHP 7.2 stack with SwarrotBundle and we 're font of a issue that can't passed PHP CS-Fixer rules:
We need to type-hinting the processor return with
?bool
when using the middleware configuratorswarrot.processor.ack
.So the resposability of ack/no'ack depends on this configurator.
How can we do that without "re-create" the ack processor ?
Thanks in advance