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
OrderedInterfacesFixer - Introduction #4113
OrderedInterfacesFixer - Introduction #4113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff 👍
64b5187
to
b57bd17
Compare
ccdd657
to
6db4784
Compare
bf91a4b
to
292828b
Compare
I let myself resolve the conflicts, readme was not regenerated after changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule is not safe.
I tried to apply it to our own codebase:
ker@dus:~/github/PHP-CS-Fixer λ git ds src/AbstractFixer.php
diff --git a/src/AbstractFixer.php b/src/AbstractFixer.php
index 44a07d83..af0cb1da 100644
--- a/src/AbstractFixer.php
+++ b/src/AbstractFixer.php
@@ -33,7 +33,7 @@
*
* @internal
*/
-abstract class AbstractFixer implements FixerInterface, DefinedFixerInterface
+abstract class AbstractFixer implements DefinedFixerInterface, FixerInterface
{
ker@dus:~/github/PHP-CS-Fixer λ vendor/bin/phpunit
PHP Fatal error: Class PhpCsFixer\AbstractFixer cannot implement previously implemented interface PhpCsFixer\Fixer\FixerInterface in /home/d.ruminski/github/PHP-CS-Fixer/src/AbstractFixer.php on line 36
It has to at least be marked as risky
I will mark as risky. However, in the case of our own code base, isn't it bad practise anyway to have this interface-duplication? I mean, |
it doesn't harm to be explicit, it could also be because it makes merging over the various branches more easy, but maybe it is (indeed) overcomplete and can be cleaned up some day in another PR
I have no idea, it really puzzles me!, sadly it does break, so please update to be |
I wouldn't consider it a bad idea. If you want to implement interfaces A and B, you may not know, not control, or even not care internal detail that B also implement A under the hood. Yet, this rule can break the code in current PHP engine, so we need risky flag with good explanation to the user why is it so. |
e8ccc9b
to
2e608da
Compare
7c06801
to
34fb22b
Compare
@keradus all changes have been processed (like, 3 months ago 😜) could you update your review? |
34fb22b
to
cbc655a
Compare
Thank you @dmvdbrugge. |
post mortem, @dmvdbrugge - pushing fixes to PR doesn't mark the PR as changed for repo maintainer (or at least to me). without new comment (!= commit), it's hard to notice that sth changed |
Fixes #4108