| @@ 252-271 (lines=20) @@ | ||
| 249 | * |
|
| 250 | * @return void |
|
| 251 | */ |
|
| 252 | private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 253 | { |
|
| 254 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
| 255 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
| 256 | return; |
|
| 257 | } |
|
| 258 | ||
| 259 | foreach ($typeHints as $hint) { |
|
| 260 | ||
| 261 | $typeHintLc = strtolower($hint); |
|
| 262 | ||
| 263 | if (isset($this->newInterfaces[$typeHintLc]) === true) { |
|
| 264 | $itemInfo = array( |
|
| 265 | 'name' => $hint, |
|
| 266 | 'nameLc' => $typeHintLc, |
|
| 267 | ); |
|
| 268 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
| 269 | } |
|
| 270 | } |
|
| 271 | } |
|
| 272 | ||
| 273 | ||
| 274 | /** |
|
| @@ 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 | /** |
|