for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TomPHP\ContainerConfigurator\FileReader;
use Assert\Assertion;
use Symfony\Component\Yaml;
use TomPHP\ContainerConfigurator\Exception\InvalidConfigException;
final class YAMLFileReader implements FileReader
{
public function read($filename)
Assertion::file($filename);
try {
$config = Yaml\Yaml::parse(file_get_contents($filename));
} catch (Yaml\Exception\ParseException $exception) {
throw InvalidConfigException::fromYAMLFileError($filename, $exception->getMessage());
}
return $config;