Closed cebe closed 7 years ago
@rob006
I've fixed print_r
related regressions and (int)
cast in master. These are definitely bugs in CS fixer or rules so it should be fixed there as well.
If statements changes in views are looking OK to me though.
Most of these changes are done by me, not php-cs-fixer. As far as I remember it has some indentation issues with multiline if
so I converted these views to follow Plates rules (it seems that Yii follows them in other places anyway). Personally I think that these rules makes views more readable and forces good practices on you - you should avoid having complicated logic in views, and it is really hard to having it and following Plates rules in the same time. Personally it helps me detect CS issues in views in my projects and and make them more readable, but this is your choice, you can revert it (and then you should probably exclude these files from php-cs-fixer processing). But inline if
s like if ($domething) $this->doSomething()
is a nightmare, I see no reason to make exception and allow them in views.
This print_r
bug is definitely my fault, sorry about that. :/
About (int)
typecast - do we really need this? + 1
should typecast this to int anyway.
Views part is fine. I remember (int)
typecast was there for a reason but have no time do dig into it now...
Was print_r
done by you or by CS fixer?
Probably me, but I don't remember exactly what happened then. Try run php-cs-fixer on master and if it does not break it again, I would assume that was my change.
Done. Seems these either were changed made before adjusting current rules or were made manually. Anyway, current fixer rules set is fine with that case.
Because of #14492 I have reviewed the changes made by PHP-CS-Fixer in ba0ab403b52124c941dbeb46fbd9efdc12252a5d by @rob006 again and found the following issues. Listing them here because navigating comments in such large PRs is a pain on github:
(int)
cast has been lost.