File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/Dflydev/DotAccessConfiguration Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Dflydev \DotAccessConfiguration ;
1313
14+ use Psr \Log \InvalidArgumentException ;
1415use Symfony \Component \Yaml \Yaml ;
1516
1617class YamlConfigurationBuilder extends AbstractConfigurationBuilder
@@ -38,7 +39,16 @@ public function __construct($input = null)
3839 public function internalBuild (ConfigurationInterface $ configuration )
3940 {
4041 if (null !== $ this ->input ) {
41- $ configuration ->importRaw (Yaml::parse ($ this ->input ));
42+ try {
43+ $ yml = Yaml::parse ($ this ->input , true );
44+ } catch (\Exception $ e ) {
45+ throw new InvalidArgumentException ($ e ->getMessage (), 0 , $ e );
46+ }
47+ if (is_string ($ yml ))
48+ {
49+ throw (new \InvalidArgumentException ('Yaml could not be parsed, parser detected a string. ' ));
50+ }
51+ $ configuration ->importRaw ($ yml );
4252 }
4353 }
4454}
You can’t perform that action at this time.
0 commit comments