| @@ 307-327 (lines=21) @@ | ||
| 304 | * |
|
| 305 | * @return void |
|
| 306 | */ |
|
| 307 | private function processFunctionToken(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 308 | { |
|
| 309 | // Retrieve typehints stripped of global NS indicator and/or nullable indicator. |
|
| 310 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
| 311 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
| 312 | return; |
|
| 313 | } |
|
| 314 | ||
| 315 | foreach ($typeHints as $hint) { |
|
| 316 | ||
| 317 | $typeHintLc = strtolower($hint); |
|
| 318 | ||
| 319 | if (isset($this->newClasses[$typeHintLc]) === true) { |
|
| 320 | $itemInfo = array( |
|
| 321 | 'name' => $hint, |
|
| 322 | 'nameLc' => $typeHintLc, |
|
| 323 | ); |
|
| 324 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
| 325 | } |
|
| 326 | } |
|
| 327 | } |
|
| 328 | ||
| 329 | ||
| 330 | /** |
|
| @@ 232-251 (lines=20) @@ | ||
| 229 | * |
|
| 230 | * @return void |
|
| 231 | */ |
|
| 232 | private function processFunctionToken(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 233 | { |
|
| 234 | $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); |
|
| 235 | if (empty($typeHints) || is_array($typeHints) === false) { |
|
| 236 | return; |
|
| 237 | } |
|
| 238 | ||
| 239 | foreach ($typeHints as $hint) { |
|
| 240 | ||
| 241 | $typeHintLc = strtolower($hint); |
|
| 242 | ||
| 243 | if (isset($this->newInterfaces[$typeHintLc]) === true) { |
|
| 244 | $itemInfo = array( |
|
| 245 | 'name' => $hint, |
|
| 246 | 'nameLc' => $typeHintLc, |
|
| 247 | ); |
|
| 248 | $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); |
|
| 249 | } |
|
| 250 | } |
|
| 251 | } |
|
| 252 | ||
| 253 | ||
| 254 | /** |
|