use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class MyConfiguration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('my_config'); $rootNode ->children() ->scalarNode('my_value')->end() ->end(); return $treeBuilder; } } $config = new MyConfiguration(); $rawConfig = ['my_value' => 'foo']; $value = $config->getSafe('my_value', $rawConfig);
use Illuminate\Config\Repository; $config = new Repository(['my_value' => 'foo']); $value = $config->getSafe('my_value');
use Zend\Config\Config; $config = new Config(['my_value' => 'foo']); $value = $config->getSafe('my_value');