src/YamlDefinitionLoader.php
protected function loadFile($file)
    {
        if (!stream_is_local($file)) {
            throw new InvalidArgumentException(sprintf('This is not a local file "%s".', $file));
        }

        if (!is_readable($file)) {
            throw new FileNotFoundException(sprintf('The file "%s" does not exist or is not readable.', $file));
        }

        $yamlParser = new Parser();

        try {
            $configuration = $yamlParser->parse(file_get_contents($file));
        } catch (ParseException $e) {
            throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
        }

        return $this->validate($configuration, $file);
    }
protected function loadFile($file)
    {
        if (!stream_is_local($file)) {
            throw new InvalidArgumentException(sprintf('This is not a local file "%s".', $file));
        }

        if (!is_readable($file)) {
            throw new FileNotFoundException(sprintf('The file "%s" does not exist or is not readable.', $file));
        }

        $yamlParser = new Parser();

        try {
            $configuration = $yamlParser->parse(file_get_contents($file));
        } catch (ParseException $e) {
            throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
        }

        return $this->validate($configuration, $file);
    }
Loads a YAML file.

@param string $file

@return array The file content

@throws InvalidArgumentException when the given file is not a local file or when it does not exist