Skip to content

Commit

Permalink
Merge a0a119f into 8955a74
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Mar 21, 2020
2 parents 8955a74 + a0a119f commit 108a252
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions PHPCSUtils/Tokens/Collections.php
Expand Up @@ -260,6 +260,21 @@ class Collections
\T_INTERFACE => \T_INTERFACE,
];

/**
* Tokens types used for "forwarding" calls within OO structures.
*
* @link https://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
*
* @since 1.0.0
*
* @var array <int|string> => <int|string>
*/
public static $OOHierarchyKeywords = [
\T_PARENT => \T_PARENT,
\T_SELF => \T_SELF,
\T_STATIC => \T_STATIC,
];

/**
* Tokens types which can be encountered in the fully/partially qualified name of an OO structure.
*
Expand Down
4 changes: 1 addition & 3 deletions PHPCSUtils/Utils/Operators.php
Expand Up @@ -149,9 +149,7 @@ public static function isReference(File $phpcsFile, $stackPtr)
} else {
$skip = Tokens::$emptyTokens;
$skip += Collections::$OONameTokens;
$skip[] = \T_SELF;
$skip[] = \T_PARENT;
$skip[] = \T_STATIC;
$skip += Collections::$OOHierarchyKeywords;
$skip[] = \T_DOUBLE_COLON;

$nextSignificantAfter = $phpcsFile->findNext(
Expand Down

0 comments on commit 108a252

Please sign in to comment.