| @@ 238-257 (lines=20) @@ | ||
| 235 | * |
|
| 236 | * @return void |
|
| 237 | */ |
|
| 238 | private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 239 | { |
|
| 240 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
| 241 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
| 242 | return; |
|
| 243 | } |
|
| 244 | ||
| 245 | foreach ($typeHints as $hint) { |
|
| 246 | ||
| 247 | $typeHintLc = strtolower($hint); |
|
| 248 | ||
| 249 | if (isset($this->newInterfaces[$typeHintLc]) === true) { |
|
| 250 | $itemInfo = array( |
|
| 251 | 'name' => $hint, |
|
| 252 | 'nameLc' => $typeHintLc, |
|
| 253 | ); |
|
| 254 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
| 255 | } |
|
| 256 | } |
|
| 257 | } |
|
| 258 | ||
| 259 | ||
| 260 | /** |
|
| @@ 673-693 (lines=21) @@ | ||
| 670 | * |
|
| 671 | * @return void |
|
| 672 | */ |
|
| 673 | private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 674 | { |
|
| 675 | // Retrieve typehints stripped of global NS indicator and/or nullable indicator. |
|
| 676 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
| 677 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
| 678 | return; |
|
| 679 | } |
|
| 680 | ||
| 681 | foreach ($typeHints as $hint) { |
|
| 682 | ||
| 683 | $typeHintLc = strtolower($hint); |
|
| 684 | ||
| 685 | if (isset($this->newClasses[$typeHintLc]) === true) { |
|
| 686 | $itemInfo = array( |
|
| 687 | 'name' => $hint, |
|
| 688 | 'nameLc' => $typeHintLc, |
|
| 689 | ); |
|
| 690 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
| 691 | } |
|
| 692 | } |
|
| 693 | } |
|
| 694 | ||
| 695 | ||
| 696 | /** |
|