mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Minor improvement to self member reference linter rule
Summary: Ref T7409. If `::` is surrounded by whitespace tokens and the whitespace token contains a newline character, allow it. Test Plan: Added test case. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7409 Differential Revision: https://secure.phabricator.com/D12391
This commit is contained in:
parent
e233b158f2
commit
51b5c70010
2 changed files with 10 additions and 0 deletions
|
@ -3459,6 +3459,10 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
|||
|
||||
foreach ($tokens as $token) {
|
||||
if ($token->isAnyWhitespace()) {
|
||||
if (strpos($token->getValue(), "\n") !== false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->raiseLintAtToken(
|
||||
$token,
|
||||
self::LINT_SELF_MEMBER_REFERENCE,
|
||||
|
|
|
@ -21,6 +21,9 @@ class Foo extends Bar {
|
|||
}
|
||||
|
||||
MyClass :: myMethod();
|
||||
|
||||
SomeReallyLongClassName
|
||||
::someMethod();
|
||||
~~~~~~~~~~
|
||||
error:3:7
|
||||
advice:7:5
|
||||
|
@ -54,3 +57,6 @@ class Foo extends Bar {
|
|||
}
|
||||
|
||||
MyClass::myMethod();
|
||||
|
||||
SomeReallyLongClassName
|
||||
::someMethod();
|
||||
|
|
Loading…
Reference in a new issue