public function fromUri(Uri $uri): Configuration
    {
        $filename = (string) $uri;

        if (!file_exists($filename)) {
            throw new \InvalidArgumentException(sprintf('File %s could not be found', $filename));
        }

        $xml = new \SimpleXMLElement($filename, 0, true);
        foreach ($this->strategies as $strategy) {
            if ($strategy->supports($xml) !== true) {
                continue;
            }

            return new Configuration($this->applyMiddleware($strategy->convert($xml)));
        }

        throw new RuntimeException('No supported configuration files were found');
    }
public function fromUri(Uri $uri): Configuration
    {
        $filename = (string) $uri;

        if (!file_exists($filename)) {
            throw new \InvalidArgumentException(sprintf('File %s could not be found', $filename));
        }

        $xml = new \SimpleXMLElement($filename, 0, true);
        foreach ($this->strategies as $strategy) {
            if ($strategy->supports($xml) !== true) {
                continue;
            }

            return new Configuration($this->applyMiddleware($strategy->convert($xml)));
        }

        throw new RuntimeException('No supported configuration files were found');
    }
public function fromUri ( Uri $ uri ) : Configuration { $ filename = ( string ) $ uri ; if ( ! file_exists ( $ filename ) ) { throw new \ InvalidArgumentException ( sprintf ( 'File %s could not be found' , $ filename ) ) ; } $ xml = new \ SimpleXMLElement ( $ filename , 0 , true ) ; foreach ( $ this -> strategies as $ strategy ) { if ( $ strategy -> supports ( $ xml ) !== true ) { continue ; } return new Configuration ( $ this -> applyMiddleware ( $ strategy -> convert ( $ xml ) ) ) ; } throw new RuntimeException ( 'No supported configuration files were found' ) ; }
Converts the phpDocumentor configuration xml to an array.

@param Uri $uri The location of the file to be loaded.

@return Configuration
@throws RuntimeException if no matching strategy can be found.
Converts the phpDocumentor configuration xml to an array .