Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Stop false positives for object methods with the same name as removed…
Browse files Browse the repository at this point in the history
… extensions
  • Loading branch information
jeffery committed Jan 26, 2012
1 parent e2c98e9 commit 6d59b30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sniffs/PHP/RemovedExtensionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
return;
}

if ( $tokens[$previous]['code'] === T_OBJECT_OPERATOR ) {
// We are calling a method of an object
return;
}

foreach ($this->removedExtensions as $extension => $alternative) {
if (strpos($tokens[$stackPtr]['content'], $extension) === 0) {
if (!is_null($alternative)) {
Expand Down

0 comments on commit 6d59b30

Please sign in to comment.