| @@ 44-52 (lines=9) @@ | ||
| 41 | */ |
|
| 42 | private function validateFileStructure(array &$file) |
|
| 43 | { |
|
| 44 | if (false === array_key_exists(self::TODO_FINDER, $file)) { |
|
| 45 | throw new FileParserException( |
|
| 46 | sprintf( |
|
| 47 | 'Provided YAML file does not compile with the required format. ' |
|
| 48 | .'Expected \'%s\' key to be present but none was found.', |
|
| 49 | self::TODO_FINDER |
|
| 50 | ) |
|
| 51 | ); |
|
| 52 | } |
|
| 53 | ||
| 54 | $this->assertYamlKey($file[self::TODO_FINDER], self::TOTAL_ALLOWED); |
|
| 55 | $this->assertYamlKey($file[self::TODO_FINDER], self::EXPRESSIONS); |
|
| @@ 66-75 (lines=10) @@ | ||
| 63 | */ |
|
| 64 | private function assertYamlKey(array &$file, $key) |
|
| 65 | { |
|
| 66 | if (false === array_key_exists($key, $file)) { |
|
| 67 | throw new FileParserException( |
|
| 68 | sprintf( |
|
| 69 | 'Provided YAML file does not compile with the required format. ' |
|
| 70 | .'Expected \'%s\' key under \'%s\' to be present but none was found.', |
|
| 71 | $key, |
|
| 72 | self::TODO_FINDER |
|
| 73 | ) |
|
| 74 | ); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|