for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Admingenerator\GeneratorBundle\Validator;
use Symfony\Component\Yaml\Yaml;
use Admingenerator\GeneratorBundle\Generator\Generator;
class BaseValidator
{
/**
* @param string $yaml_path
*/
protected function getFromYaml(Generator $generator, $yaml_path, $default = null)
$search_in = Yaml::parse(file_get_contents($generator->getGeneratorYml()));
$yaml_path = explode('.',$yaml_path);
foreach ($yaml_path as $key) {
if (!isset($search_in[$key])) {
return $default;
}
$search_in = $search_in[$key];
return $search_in;