/**
  * @param Tokens         $tokens
  * @param TokensAnalyzer $tokensAnalyzer
  * @param int            $classStart
  * @param int            $classEnd
  */
 private function fixClass(Tokens $tokens, TokensAnalyzer $tokensAnalyzer, $classStart, $classEnd)
 {
     for ($index = $classEnd; $index > $classStart; --$index) {
         if (!$tokens[$index]->isGivenKind(T_FUNCTION) || $tokensAnalyzer->isLambda($index)) {
             continue;
         }
         $attributes = $tokensAnalyzer->getMethodAttributes($index);
         if (true === $attributes['abstract']) {
             $methodEnd = $tokens->getNextTokenOfKind($index, array(';'));
         } else {
             $methodStart = $tokens->getNextTokenOfKind($index, array('{'));
             $methodEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $methodStart, true);
         }
         $this->fixSpaceBelowMethod($tokens, $classEnd, $methodEnd);
         $this->fixSpaceAboveMethod($tokens, $classStart, $index);
     }
 }
 /**
  * @dataProvider provideGetFunctionProperties
  */
 public function testGetFunctionProperties($source, $index, $expected)
 {
     $tokens = Tokens::fromCode($source);
     $tokensAnalyzer = new TokensAnalyzer($tokens);
     $attributes = $tokensAnalyzer->getMethodAttributes($index);
     $this->assertSame($expected, $attributes);
 }