Skip to content

Commit ea15f3d

Browse files
committed
Merge pull request #61 from rgazelot/top-level-missing
Add a more detailed exception message when a top-level key is missing.
2 parents 15b15d8 + 1363665 commit ea15f3d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function processFile(array $config)
3333
// Find the expected params
3434
$expectedValues = $yamlParser->parse(file_get_contents($config['dist-file']));
3535
if (!isset($expectedValues[$parameterKey])) {
36-
throw new \InvalidArgumentException('The dist file seems invalid.');
36+
throw new \InvalidArgumentException(sprintf('The top-level key %s is missing.', $parameterKey));
3737
}
3838
$expectedParams = (array) $expectedValues[$parameterKey];
3939

Tests/ProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function provideInvalidConfiguration()
7474
array(
7575
'file' => 'fixtures/invalid/missing_top_level.yml',
7676
),
77-
'The dist file seems invalid.',
77+
'The top-level key parameters is missing.',
7878
),
7979
'invalid values in the existing file' => array(
8080
array(

0 commit comments

Comments
 (0)