public function check(\SplFileInfo $file, Tokens $tokens)
    {
        $classes = array_keys($tokens->findGivenKind(T_CLASS));
        $numClasses = count($classes);

        for ($i = 0; $i < $numClasses; ++$i) {
            $index = $classes[$i];

            // figure out where the classy starts
            $classStart = $tokens->getNextTokenOfKind($index, array('{'));

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

            $this->checkMethods($tokens, $classStart, $classEnd);
        }
    }
public function check(\SplFileInfo $file, Tokens $tokens)
    {
        $classes = array_keys($tokens->findGivenKind(T_CLASS));
        $numClasses = count($classes);

        for ($i = 0; $i < $numClasses; ++$i) {
            $index = $classes[$i];

            // figure out where the classy starts
            $classStart = $tokens->getNextTokenOfKind($index, array('{'));

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

            $this->checkMethods($tokens, $classStart, $classEnd);
        }
    }
public function check ( \ SplFileInfo $ file , Tokens $ tokens ) { $ classes = array_keys ( $ tokens -> findGivenKind ( T_CLASS ) ) ; $ numClasses = count ( $ classes ) ; for ( $ i = 0 ; $ i < $ numClasses ; ++ $ i ) { $ index = $ classes [ $ i ] ; // figure out where the classy starts $ classStart = $ tokens -> getNextTokenOfKind ( $ index , array ( '{' ) ) ; // figure out where the classy ends $ classEnd = $ tokens -> findBlockEnd ( Tokens :: BLOCK_TYPE_CURLY_BRACE , $ classStart ) ; $ this -> checkMethods ( $ tokens , $ classStart , $ classEnd ) ; } }
Checks a file.

@param \SplFileInfo $file A \SplFileInfo instance
@param Tokens $tokens Tokens collection
Checks a file .