public function findClass($path)
    {
        $namespace = null;
        $tokens = token_get_all(file_get_contents($path));
        foreach ($tokens as $key => $token) {
            if ($this->tokenIsNamespace($token)) {
                $namespace = $this->getNamespace($key + 2, $tokens);
            } elseif ($this->tokenIsClassOrInterface($token)) {
                return ltrim($namespace.'\\'.$this->getClass($key + 2, $tokens), '\\');
            }
        }
    }
public function findClass($path)
    {
        $namespace = null;
        $tokens = token_get_all(file_get_contents($path));
        foreach ($tokens as $key => $token) {
            if ($this->tokenIsNamespace($token)) {
                $namespace = $this->getNamespace($key + 2, $tokens);
            } elseif ($this->tokenIsClassOrInterface($token)) {
                return ltrim($namespace.'\\'.$this->getClass($key + 2, $tokens), '\\');
            }
        }
    }
public function findClass ( $ path ) { $ namespace = null ; $ tokens = token_get_all ( file_get_contents ( $ path ) ) ; foreach ( $ tokens as $ key => $ token ) { if ( $ this -> tokenIsNamespace ( $ token ) ) { $ namespace = $ this -> getNamespace ( $ key + 2 , $ tokens ) ; } elseif ( $ this -> tokenIsClassOrInterface ( $ token ) ) { return ltrim ( $ namespace . '\\' . $ this -> getClass ( $ key + 2 , $ tokens ) , '\\' ) ; } } }
Extract the class name from the file at the given path.

@param  string  $path
@return string|null
Extract the class name from the file at the given path .