private function fixClassy(Tokens $tokens, $index)
    {
        // figure out where the classy starts
        $classOpenIndex = $tokens->getNextTokenOfKind($index, ['{']);

        // figure out where the classy ends
        $classEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpenIndex);

        // is classy extending or implementing some interface
        $extendingOrImplementing = $this->isExtendingOrImplementing($tokens, $index, $classOpenIndex);

        if (!$extendingOrImplementing) {
            // PHPDoc of classy should not have inherit tag even when using traits as Traits cannot provide this information
            $this->fixClassyOutside($tokens, $index);
        }

        // figure out if the classy uses a trait
        if (!$extendingOrImplementing && $this->isUsingTrait($tokens, $index, $classOpenIndex, $classEndIndex)) {
            $extendingOrImplementing = true;
        }

        $this->fixClassyInside($tokens, $classOpenIndex, $classEndIndex, !$extendingOrImplementing);

        return $classEndIndex;
    }
private function fixClassy(Tokens $tokens, $index)
    {
        
        $classOpenIndex = $tokens->getNextTokenOfKind($index, ['{']);

        
        $classEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpenIndex);

        
        $extendingOrImplementing = $this->isExtendingOrImplementing($tokens, $index, $classOpenIndex);

        if (!$extendingOrImplementing) {
            
            $this->fixClassyOutside($tokens, $index);
        }

        
        if (!$extendingOrImplementing && $this->isUsingTrait($tokens, $index, $classOpenIndex, $classEndIndex)) {
            $extendingOrImplementing = true;
        }

        $this->fixClassyInside($tokens, $classOpenIndex, $classEndIndex, !$extendingOrImplementing);

        return $classEndIndex;
    }
private function fixClassy ( Tokens $ tokens , $ index ) { // figure out where the classy starts $ classOpenIndex = $ tokens -> getNextTokenOfKind ( $ index , [ '{' ] ) ; // figure out where the classy ends $ classEndIndex = $ tokens -> findBlockEnd ( Tokens :: BLOCK_TYPE_CURLY_BRACE , $ classOpenIndex ) ; // is classy extending or implementing some interface $ extendingOrImplementing = $ this -> isExtendingOrImplementing ( $ tokens , $ index , $ classOpenIndex ) ; if ( ! $ extendingOrImplementing ) { // PHPDoc of classy should not have inherit tag even when using traits as Traits cannot provide this information $ this -> fixClassyOutside ( $ tokens , $ index ) ; } // figure out if the classy uses a trait if ( ! $ extendingOrImplementing && $ this -> isUsingTrait ( $ tokens , $ index , $ classOpenIndex , $ classEndIndex ) ) { $ extendingOrImplementing = true ; } $ this -> fixClassyInside ( $ tokens , $ classOpenIndex , $ classEndIndex , ! $ extendingOrImplementing ) ; return $ classEndIndex ; }
@param Tokens $tokens
@param int    $index

@return int
@param Tokens $tokens @param int $index