Loading coder_sniffer/DrupalPractice/Sniffs/Objects/UnusedPrivateMethodSniff.php +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ class UnusedPrivateMethodSniff extends AbstractScopeSniff $tokens = $phpcsFile->getTokens(); $methodName = $phpcsFile->getDeclarationName($stackPtr); if ($methodName === '__construct') { return; } $classPtr = key($tokens[$stackPtr]['conditions']); // Search for direct $this->methodCall() or indirect callbacks [$this, Loading coder_sniffer/DrupalPractice/Test/Objects/UnusedPrivateMethodUnitTest.inc +7 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,13 @@ class Test { /** * Private constructor in case class can be instantiated. */ private function __construct() { } /** * Method is not called from anywhere in the class. */ Loading coder_sniffer/DrupalPractice/Test/Objects/UnusedPrivateMethodUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class UnusedPrivateMethodUnitTest extends CoderSniffUnitTest */ protected function getWarningList() { return [8 => 1]; return [15 => 1]; }//end getWarningList() Loading Loading
coder_sniffer/DrupalPractice/Sniffs/Objects/UnusedPrivateMethodSniff.php +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ class UnusedPrivateMethodSniff extends AbstractScopeSniff $tokens = $phpcsFile->getTokens(); $methodName = $phpcsFile->getDeclarationName($stackPtr); if ($methodName === '__construct') { return; } $classPtr = key($tokens[$stackPtr]['conditions']); // Search for direct $this->methodCall() or indirect callbacks [$this, Loading
coder_sniffer/DrupalPractice/Test/Objects/UnusedPrivateMethodUnitTest.inc +7 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,13 @@ class Test { /** * Private constructor in case class can be instantiated. */ private function __construct() { } /** * Method is not called from anywhere in the class. */ Loading
coder_sniffer/DrupalPractice/Test/Objects/UnusedPrivateMethodUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class UnusedPrivateMethodUnitTest extends CoderSniffUnitTest */ protected function getWarningList() { return [8 => 1]; return [15 => 1]; }//end getWarningList() Loading