@@ 675-695 (lines=21) @@ | ||
672 | * |
|
673 | * @return void |
|
674 | */ |
|
675 | private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
676 | { |
|
677 | // Retrieve typehints stripped of global NS indicator and/or nullable indicator. |
|
678 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
679 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
680 | return; |
|
681 | } |
|
682 | ||
683 | foreach ($typeHints as $hint) { |
|
684 | ||
685 | $typeHintLc = strtolower($hint); |
|
686 | ||
687 | if (isset($this->newClasses[$typeHintLc]) === true) { |
|
688 | $itemInfo = array( |
|
689 | 'name' => $hint, |
|
690 | 'nameLc' => $typeHintLc, |
|
691 | ); |
|
692 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
693 | } |
|
694 | } |
|
695 | } |
|
696 | ||
697 | ||
698 | /** |
@@ 255-274 (lines=20) @@ | ||
252 | * |
|
253 | * @return void |
|
254 | */ |
|
255 | private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
256 | { |
|
257 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
258 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
259 | return; |
|
260 | } |
|
261 | ||
262 | foreach ($typeHints as $hint) { |
|
263 | ||
264 | $typeHintLc = strtolower($hint); |
|
265 | ||
266 | if (isset($this->newInterfaces[$typeHintLc]) === true) { |
|
267 | $itemInfo = array( |
|
268 | 'name' => $hint, |
|
269 | 'nameLc' => $typeHintLc, |
|
270 | ); |
|
271 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
272 | } |
|
273 | } |
|
274 | } |
|
275 | ||
276 | ||
277 | /** |