Skip to content
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

Do not require space after case #146

Merged
merged 1 commit into from
Dec 11, 2019
Merged

Do not require space after case #146

merged 1 commit into from
Dec 11, 2019

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Dec 9, 2019

I think I missed this one. Currently I cannot write

switch($y) {
    case 1:
    case 2:
        // do sth
}

but have to write

switch($y) {
    case 1:

    case 2:
        // do sth
}

Which is IMO not desired. So this drops the requirement to have space after case.

@simPod simPod requested a review from a team as a code owner December 9, 2019 13:43
carusogabriel
carusogabriel previously approved these changes Dec 9, 2019
Copy link
Contributor

@carusogabriel carusogabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to go as 7.0.1, right @doctrine/coding-standard-approvers?

malarzm
malarzm previously approved these changes Dec 9, 2019
@greg0ire
Copy link
Member

greg0ire commented Dec 9, 2019

@carusogabriel if that's the case the label should probably not be "improvement".

greg0ire
greg0ire previously approved these changes Dec 9, 2019
Copy link
Member

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the correct fix. I mean, depending on the usage we should have a space before of break:

foreach (blah() as $item) {
    if (something()) {
        echo 'doing this...';

        break;
   }

    echo 'doing that...';
}

Can we have this as a test too?

Two minutes after I posted this my brain started functioning properly and I realised I just said non-sense in this comment. I'm sorry.

I swear am not on drugs (maybe that's the problem 🤪)

tests/input/example-class.php Outdated Show resolved Hide resolved
Copy link
Member

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to request changes (this old mobile UI isn't my friend)...

@simPod
Copy link
Contributor Author

simPod commented Dec 10, 2019

@lcobucci is initializing

I'll extract tests, wanted to do so for a long time already :)

lcobucci
lcobucci previously approved these changes Dec 10, 2019
malarzm
malarzm previously approved these changes Dec 10, 2019
@Ocramius Ocramius self-assigned this Dec 11, 2019
@Ocramius Ocramius merged commit d8a60ec into doctrine:master Dec 11, 2019
@Ocramius
Copy link
Member

Hmm, release 7.0.1 was botched due to this not targeting the 7.x branch (7.0.0 and 7.0.1 point to the same commit) : will need to move this to 7.0.2 and do some stuff manually when I got time

@Ocramius Ocramius modified the milestones: 7.0.1, 7.0.2 Dec 11, 2019
@simPod simPod deleted the do-not-require-space-after-case branch December 11, 2019 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants