-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add doctrine/conding-standard as phpcs rule #210
Conversation
If the diff is really all there is to it, it seems like we're already quite in line with it anyway :-) |
No the diff is only that stuff that could be auto fixed. There is alot more todo. I will add the CI job as a next step :) |
Well I added a config file now and added phpcs to the CI. Now i got some more autofixes and some tests are crashing now. And alot of issues are still open in phpcs. So it'll be alot of work. But for tomorrow :D |
…ector::recordFunctionParameterTypesUsage due to phpcbf autofix to an earlyout that let to false types
Tests are fixed now. It was just a little thing.. 🥳 |
@Ocramius this patch is almost ready. There are still 3 warnings open. I dont really know how to solve this with the line length and the arrays since i cannot create a newline with only one value in the array. :D |
We could disable that rule: it ain't vital |
Okay now the patch is ready for review. I excluded now the file too long cs. One bigger change is made here. |
Yep, we need @maglnet to hop in and shut them down in the repo settings :D |
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.
LGTM, but the rename of GuesserInterface
to Guesser
, as well as the exception names, is a BC break that requires a new major release.
IMO fine, but we'd have to rename 2.2.0
to 3.0.0
.
There are also many non-final
symbols for which public
and protected
API changed, so that is also a BC break.
@maglnet I need your review on this, but from a coding perspective it is fine (besides minor comments).
If all is fine, I'd rename the milestone to 3.0.0
and move on from there.
|
||
/** | ||
* @internal |
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.
'bit of a BC break, but IMO acceptable, since this isn't really a library
) | ||
&& $node->class instanceof Node\Name | ||
if ( | ||
(! ($node instanceof Node\Expr\StaticCall) |
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 conditional got much harder to read: a simpler way to change this is to reverse it with a single !
in front of the original version
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.
With this psalm could not get the type right. Now the condition is split in two and is with this IMHO definitely more readable than before. WDYT?
I could also revert some of BC's if this helps :) |
IMO they make sense, and the upgrade would be painless for 99.9% of users out there (if we go for 3.0.0): it's just a decision that the repo owner has to take. |
…m cannot interfere the type correctly, psalm things its a property check on a interface; Interfaces cannot have properties (see https://psalm.dev/028)
I'm sorry, currently I cannot relly invest time in OSS, sad but true 🙈 I'm totally fine with BC breaking changes for a 3.0.0 release since this does not really affect the CLI API, which is the API for nearly all users of this package. @Ocramius @DanielBadura |
No problem at all! As far as i know: Disabling AppVeyor & Scrutinizer should be all. No need to add a new CI-Job. |
@maglnet no worries, it is what it is :-) |
@Ocramius is here something missing that i could take care of? |
I'm fine with it, will keep this in the next major, and we roll with that 👍 |
Thanks, @DanielBadura! |
This PR aims to get a coding standard into the project to improve readability and maintainability. I chose
doctrine/coding-standard
but if wanted we can switch the cs rules or requireslevomat/coding-standard
orsquizlabs/php_codesniffer
directly. Also adding / removing rules should be no problem.At the moment I only installed the package and let
phpcbf
auto fix the issues that could be fixed. But there are plenty more cs issues to work on.But before i work more on this i would get your opinion on this topic @Ocramius @maglnet :)
I would also add it to the CI and maybe remove the scrutinizer config.