Service/GearmanParser.php
public function getFileClassNamespace($file)
    {
        $filenameBlock = explode(DIRECTORY_SEPARATOR, $file);
        $filename = explode('.', end($filenameBlock), 2);
        $filename = reset($filename);

        preg_match('/\snamespace\s+(.+?);/s', file_get_contents($file), $match);

        return    is_array($match) && isset($match[1])
                ? $match[1] . '\\' . $filename
                : false;
    }
public function getFileClassNamespace($file)
    {
        $filenameBlock = explode(DIRECTORY_SEPARATOR, $file);
        $filename = explode('.', end($filenameBlock), 2);
        $filename = reset($filename);

        preg_match('/\snamespace\s+(.+?);/s', file_get_contents($file), $match);

        return    is_array($match) && isset($match[1])
                ? $match[1] . '\\' . $filename
                : false;
    }
public function getFileClassNamespace ( $ file ) { $ filenameBlock = explode ( DIRECTORY_SEPARATOR , $ file ) ; $ filename = explode ( '.' , end ( $ filenameBlock ) , 2 ) ; $ filename = reset ( $ filename ) ; preg_match ( '/\snamespace\s+(.+?);/s' , file_get_contents ( $ file ) , $ match ) ; return is_array ( $ match ) && isset ( $ match [ 1 ] ) ? $ match [ 1 ] . '\\' . $ filename : false ; }
Returns file class namespace, if exists

@param string $file A PHP file path

@return string|false Full class namespace if found, false otherwise
Returns file class namespace if exists