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

LowercaseStaticReferenceFixer - Fix "Parent" word in namespace #3937

Merged
merged 1 commit into from Jul 30, 2018
Merged

LowercaseStaticReferenceFixer - Fix "Parent" word in namespace #3937

merged 1 commit into from Jul 30, 2018

Conversation

kubawerlos
Copy link
Contributor

No description provided.

@@ -86,7 +86,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens)
}

$prevIndex = $tokens->getPrevMeaningfulToken($index);
if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_OBJECT_OPERATOR, T_PRIVATE, T_PROTECTED, T_PUBLIC])) {
if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR, T_OBJECT_OPERATOR, T_PRIVATE, T_PROTECTED, T_PUBLIC])) {
Copy link
Member

Choose a reason for hiding this comment

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

why T_NAMESPACE? I don't see test for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will handle <?php namespace Foo\Parent; case, but it wold be handed by T_NS_SEPARATOR in next token search, so you're right - I've added one more test.

@keradus keradus added this to the 2.12.3 milestone Jul 22, 2018
@keradus keradus changed the title Fix "Parent" word in namespace in LowercaseStaticReferenceFixer LowercaseStaticReferenceFixer - Fix "Parent" word in namespace Jul 26, 2018
@keradus keradus added the RTM Ready To Merge label Jul 26, 2018
@SpacePossum
Copy link
Contributor

Thank you @kubawerlos.

@SpacePossum SpacePossum merged commit b1fcf6c into PHP-CS-Fixer:2.12 Jul 30, 2018
SpacePossum added a commit that referenced this pull request Jul 30, 2018
…ace (kubawerlos)

This PR was squashed before being merged into the 2.12 branch (closes #3937).

Discussion
----------

LowercaseStaticReferenceFixer - Fix "Parent" word in namespace

Commits
-------

b1fcf6c LowercaseStaticReferenceFixer - Fix \"Parent\" word in namespace
@SpacePossum SpacePossum removed the RTM Ready To Merge label Jul 30, 2018
@kubawerlos kubawerlos deleted the bugfix/parent-word-in-namespace branch July 30, 2018 13:05
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

3 participants