src/ConfigurationGeneratorCommand.php
/**
     * Build a full qualified class name from the file contents
     *
     * @param  string $file
     *
     * @throws InvalidArgumentException If no namespace or class have been found in the file
     *
     * @return string
     */
Build a full qualified class name from the file contents
@param  string $file

@throws InvalidArgumentException If no namespace or class have been found in the file

@return string
Build a full qualified class name from the file contents @param string $file @throws InvalidArgumentException If no namespace or class have been found in the file @return string
private function buildFQCN($file)
    {
        $fileContents = file_get_contents($file, 'r');
        preg_match('(namespace\s+(.+?);)', $fileContents, $namespaceMatches);
        preg_match('(.*class\s+(\w+))',    $fileContents, $classMatches);
        if (
            !isset($namespaceMatches[1])
            && !isset($classMatches[1])
        ) {
            return null;
        };
        $namespace = $namespaceMatches[1];
        $class     = $classMatches[1];
        return sprintf('%s\\%s', $namespace, $class);
    }
private function buildFQCN ( $ file ) { $ fileContents = file_get_contents ( $ file , 'r' ) ; preg_match ( '(namespace\s+(.+?);)' , $ fileContents , $ namespaceMatches ) ; preg_match ( '(.*class\s+(\w+))' , $ fileContents , $ classMatches ) ; if ( ! isset ( $ namespaceMatches [ 1 ] ) && ! isset ( $ classMatches [ 1 ] ) ) { return null ; } ; $ namespace = $ namespaceMatches [ 1 ] ; $ class = $ classMatches [ 1 ] ; return sprintf ( '%s\\%s' , $ namespace , $ class ) ; }
Build a full qualified class name from the file contents
 @param  string $file
Build a full qualified class name from the file contents @param string $file