public function addFromYml($fileName)
    {
        if (!\is_readable($fileName)) {
            throw new \InvalidArgumentException('Could not read config file: ' . $fileName);
        }

        $config = Yaml::parse(\file_get_contents($fileName));

        if (isset($config['mapping'])) {
            $this->addAuthorMap($config['mapping']);
        }

        if (isset($config['ignore'])) {
            $this->ignoreAuthors($config['ignore']);
        }

        if (isset($config['copy-left'])) {
            $this->addCopyLeftAuthors($config['copy-left']);
        }

        if (isset($config['include'])) {
            $this->includePaths($config['include']);
        }

        if (isset($config['exclude'])) {
            $this->excludePaths($config['exclude']);
        }

        if (isset($config['metadata'])) {
            $this->addAuthorsMetadata($config['metadata']);
        }

        return $this;
    }
public function addFromYml($fileName)
    {
        if (!\is_readable($fileName)) {
            throw new \InvalidArgumentException('Could not read config file: ' . $fileName);
        }

        $config = Yaml::parse(\file_get_contents($fileName));

        if (isset($config['mapping'])) {
            $this->addAuthorMap($config['mapping']);
        }

        if (isset($config['ignore'])) {
            $this->ignoreAuthors($config['ignore']);
        }

        if (isset($config['copy-left'])) {
            $this->addCopyLeftAuthors($config['copy-left']);
        }

        if (isset($config['include'])) {
            $this->includePaths($config['include']);
        }

        if (isset($config['exclude'])) {
            $this->excludePaths($config['exclude']);
        }

        if (isset($config['metadata'])) {
            $this->addAuthorsMetadata($config['metadata']);
        }

        return $this;
    }
public function addFromYml ( $ fileName ) { if ( ! \ is_readable ( $ fileName ) ) { throw new \ InvalidArgumentException ( 'Could not read config file: ' . $ fileName ) ; } $ config = Yaml :: parse ( \ file_get_contents ( $ fileName ) ) ; if ( isset ( $ config [ 'mapping' ] ) ) { $ this -> addAuthorMap ( $ config [ 'mapping' ] ) ; } if ( isset ( $ config [ 'ignore' ] ) ) { $ this -> ignoreAuthors ( $ config [ 'ignore' ] ) ; } if ( isset ( $ config [ 'copy-left' ] ) ) { $ this -> addCopyLeftAuthors ( $ config [ 'copy-left' ] ) ; } if ( isset ( $ config [ 'include' ] ) ) { $ this -> includePaths ( $ config [ 'include' ] ) ; } if ( isset ( $ config [ 'exclude' ] ) ) { $ this -> excludePaths ( $ config [ 'exclude' ] ) ; } if ( isset ( $ config [ 'metadata' ] ) ) { $ this -> addAuthorsMetadata ( $ config [ 'metadata' ] ) ; } return $ this ; }
Retrieve the configuration file and merge it into the instance.

@param string $fileName The filename to read.

@return Config

@throws \InvalidArgumentException When the config is not readable.
Retrieve the configuration file and merge it into the instance .