private function processFunctionToken(File $phpcsFile, $stackPtr)
    {
        // Retrieve typehints stripped of global NS indicator and/or nullable indicator.
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
        if (empty($typeHints) || \is_array($typeHints) === false) {
            return;
        }

        foreach ($typeHints as $hint) {

            $typeHintLc = strtolower($hint);

            if (isset($this->newClasses[$typeHintLc]) === true) {
                $itemInfo = array(
                    'name'   => $hint,
                    'nameLc' => $typeHintLc,
                );
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
            }
        }
    }
private function processFunctionToken(File $phpcsFile, $stackPtr)
    {
        // Retrieve typehints stripped of global NS indicator and/or nullable indicator.
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
        if (empty($typeHints) || \is_array($typeHints) === false) {
            return;
        }

        foreach ($typeHints as $hint) {

            $typeHintLc = strtolower($hint);

            if (isset($this->newClasses[$typeHintLc]) === true) {
                $itemInfo = array(
                    'name'   => $hint,
                    'nameLc' => $typeHintLc,
                );
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
            }
        }
    }
private function processFunctionToken ( File $ phpcsFile , $ stackPtr ) { // Retrieve typehints stripped of global NS indicator and/or nullable indicator. $ typeHints = $ this -> getTypeHintsFromFunctionDeclaration ( $ phpcsFile , $ stackPtr ) ; if ( empty ( $ typeHints ) || \ is_array ( $ typeHints ) === false ) { return ; } foreach ( $ typeHints as $ hint ) { $ typeHintLc = strtolower ( $ hint ) ; if ( isset ( $ this -> newClasses [ $ typeHintLc ] ) === true ) { $ itemInfo = array ( 'name' => $ hint , 'nameLc' => $ typeHintLc , ) ; $ this -> handleFeature ( $ phpcsFile , $ stackPtr , $ itemInfo ) ; } } }
Processes this test for when a function token is encountered.

- Detect new classes when used as a type hint.

@param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                   $stackPtr  The position of the current token in
the stack passed in $tokens.

@return void
Processes this test for when a function token is encountered .