Skip to content

Update compatibility patch #193

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

Closed
wants to merge 1 commit into from
Closed

Conversation

greg0ire
Copy link
Member

There have been bugfixes in slevomat/coding-standard that affect it.

@greg0ire greg0ire mentioned this pull request May 30, 2020
There have been bugfixes in slevomat/coding-standard that affect it.
@greg0ire
Copy link
Member Author

It's broken, slevomat/coding-standard fixed a bug and we need to update the expectations.

@carusogabriel do I need to update that lib?

I have this fix, doesn't look very legit, is that the bug you were talking about?

diff tests/input2/ControlStructures.php tests/fixed/ControlStructures.php
21,22c21,22
<         if (self::VERSION !== 0) {
<             return;
---
>         if (self::VERSION === 0) {
>             yield 0;
24,25d23

@carusogabriel
Copy link
Contributor

@kukulich Is this a BC/regression on slevomatic/coding-standard v6.2.X series?

@carusogabriel
Copy link
Contributor

@greg0ire I think you should update our composer.json and check which version this changed. If it was from 6.2.X -> 6.3.X, then I think your .patch should should be applied as might be a fix in the Sniff, but was fixing its behavior.

@kukulich
Copy link
Contributor

@carusogabriel I’m sorry I really don’t understand the change in the diff :)

@greg0ire
Copy link
Member Author

greg0ire commented May 30, 2020

@kukulich I might be misunderstanding but I think the input is

if (self::VERSION === 0) {
yield 0;
}

, and it's getting changed to return; and should be left untouched as shown in our current expectation:

if (self::VERSION === 0) {
yield 0;
}

the error is the following: 21 | ERROR | [x] Use early exit to reduce code nesting., and we are using v6.3.8 of slevomat/coding-standard

@greg0ire
Copy link
Member Author

greg0ire commented May 30, 2020

@carusogabriel not sure what you want me to do, the only possible move seems to be to downgrade slevomat… the current output does not make sense to me, I don't think it's a legit fix.

@carusogabriel
Copy link
Contributor

@greg0ire Update our expectations and port to master, this was a fix on their side.

I'll release a new version of this library tomorrow, I can take care of this if you want.

@greg0ire
Copy link
Member Author

Sure please, take care of it :) My PRs can definitely wait for tomorrow.

@greg0ire greg0ire closed this May 30, 2020
@greg0ire greg0ire deleted the fix-build branch May 30, 2020 14:18
@kukulich
Copy link
Contributor

@carusogabriel Yes, yield is not early exit code since 6.3.5 - because it's not early exit (really stupid mistake)

It may be good to enable ignoreOneLineTrailingIf or ignoreTrailingIfWithOneInstruction option for EarlyExitSniff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants