Skip to content

Commit

Permalink
Fixed no var tag being used. Fixed error list being triggered.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeblanco committed Aug 20, 2014
1 parent 198f9e7 commit 821e1e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions PropertyTypePerClassLimitSniff.php
Expand Up @@ -78,11 +78,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

if ($errorList) {
array_map(
$errorList,
function ($error) use ($phpcsFile, $stackPtr)
{
$phpcsFile->addError($error, $stackPtr, 'TooManyPropertiesOfType');
}
},
$errorList
);

return;
Expand Down Expand Up @@ -295,6 +295,11 @@ private function createProperty(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

$varDoc = $comment->getVar();

if ( ! $varDoc) {
// Var tag could not be processed, we should throw error
return null;
}

return array(
'token' => $property,
'pointer' => $stackPtr,
Expand Down

0 comments on commit 821e1e4

Please sign in to comment.