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

Change the do/while patterns #127

Merged
merged 2 commits into from
Mar 27, 2016
Merged

Change the do/while patterns #127

merged 2 commits into from
Mar 27, 2016

Conversation

photodude
Copy link
Contributor

Pull Request for Issue #126

Summary of Changes

Change the do/while patterns to better address the issue of Blank line between do/while

Testing Instructions

Run a Joomla-PHPCS test against a Repo with no blank line between do/while. There should not be a testing failure requiring a blank line between the do/while.

@mbabker
Copy link
Contributor

mbabker commented Mar 26, 2016

Finally got around to testing this (sorry). Didn't end up fixing the issue. I ended up adding this to the ControlStructureSpacingSniff and this did work:

if ($tokens[$trailingContent]['code'] === T_WHILE)
{
    if ($tokens[$stackPtr]['code'] === T_DO)
    {
        // DO with WHILE.
        return;
    }
}

Same type of check exists there already for an if statement with else.

@mbabker mbabker merged commit 1f97ceb into joomla:master Mar 27, 2016
@photodude photodude deleted the patch-4 branch March 27, 2016 19:35
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.

2 participants