Skip to content

Commit

Permalink
Merge pull request #4 from mrrsm/master
Browse files Browse the repository at this point in the history
Clean up undefined customAllowedTypes
  • Loading branch information
solonrice committed Nov 30, 2015
2 parents b581443 + 48cbd93 commit f51f77f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co
$typeNames = explode('|', $param['type']);
foreach ($typeNames as $typeName) {
$suggestedName = PHP_CodeSniffer::suggestType($typeName);
if ($typeName !== $suggestedName && !in_array($typeName, $this->customAllowedTypes)) {
if ($typeName !== $suggestedName) {
$error = 'Expected "%s" but found "%s" for parameter type';
$data = array(
$suggestedName,
Expand All @@ -364,7 +364,7 @@ protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co

$phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
}
} else if (count($typeNames) === 1 && !in_array($typeName, $this->customAllowedTypes)) {
} else if (count($typeNames) === 1) {
// Check type hint for array and custom type.
$suggestedTypeHint = '';
if (strpos($suggestedName, 'array') !== false || substr($suggestedName, -2) === '[]') {
Expand Down

0 comments on commit f51f77f

Please sign in to comment.