| Conditions | 3 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function load($file, $type = null) |
||
| 30 | { |
||
| 31 | if (!file_exists($file)) { |
||
| 32 | throw new FileNotFoundException(sprintf('File "%s" not found.', $file)); |
||
| 33 | } |
||
| 34 | |||
| 35 | if (!class_exists('Symfony\Component\Yaml\Yaml')) { |
||
| 36 | throw new LogicException('Loading files from the YAML format requires the Symfony Yaml component.'); |
||
| 37 | } |
||
| 38 | |||
| 39 | return Yaml::parse(file_get_contents($file), Yaml::PARSE_CONSTANT | Yaml::PARSE_DATETIME | Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE); |
||
| 40 | } |
||
| 50 |