src/Command/CommandBase.php
public function loadYamlFile($filename)
    {
        if (!file_exists($filename)) {
            $this->output->writeln("<error>The file $filename does not exist.</error>");

            return false;
        }

        try {
            $contents = Yaml::parse(file_get_contents($filename));
        } catch (\Exception $e) {
            $this->output->writeln("<error>There was an error parsing $filename. The contents are not valid YAML.</error>");
            $this->output->writeln($e->getMessage());

            return false;
        }

        return $contents;
    }
public function loadYamlFile($filename)
    {
        if (!file_exists($filename)) {
            $this->output->writeln("<error>The file $filename does not exist.</error>");

            return false;
        }

        try {
            $contents = Yaml::parse(file_get_contents($filename));
        } catch (\Exception $e) {
            $this->output->writeln("<error>There was an error parsing $filename. The contents are not valid YAML.</error>");
            $this->output->writeln($e->getMessage());

            return false;
        }

        return $contents;
    }
public function loadYamlFile ( $ filename ) { if ( ! file_exists ( $ filename ) ) { $ this -> output -> writeln ( "<error>The file $filename does not exist.</error>" ) ; return false ; } try { $ contents = Yaml :: parse ( file_get_contents ( $ filename ) ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( "<error>There was an error parsing $filename. The contents are not valid YAML.</error>" ) ; $ this -> output -> writeln ( $ e -> getMessage ( ) ) ; return false ; } return $ contents ; }
Loads a yaml file.

@param $filename
The file name.

@return array|bool
The parsed content of the yaml file. FALSE if an error occured.
Loads a yaml file .