-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with object|void
style returns
#202
Comments
I'm afraid I'm on the side of phpcs in this one. The whole "return something or nothing" concept squicks me. I think phpcs is expecting the return of a null object in this case, i.e., something that supports CommandInterface but does nothing and is nothing. It's a different approach to the design of the code, but it pays off in simplicity down the line as the code can be less defensive (no more "test value before calling" cluttering up the code flow). references: |
Changing my API implementation is easy (especially as this is new code). But, we do have cases throughout the project where we do have a mixed returns like this and IMO it could start to be problematic if we force code refactoring (with behavior changes) on existing APIs to appease a code style rule. |
I believe the code should handle mixed returns, Possibly need to review the source file for differences as there were some big changes in 2.8 which I think was released after the last time I reviewed our custom sniffs for differences. There are 4 changes to that file since I last reviewed it. One of the changes might be related to the issue here. |
Results in...
The text was updated successfully, but these errors were encountered: