| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function load($resource, $locale, $domain = 'messages') |
||
| 44 | { |
||
| 45 | if (!$this->filesystem->has($resource)) { |
||
| 46 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); |
||
| 47 | } |
||
| 48 | |||
| 49 | $catalogue = new MessageCatalogue($locale); |
||
| 50 | $this->extractFromContent($this->filesystem->read($resource), $catalogue, $domain); |
||
|
|
|||
| 51 | |||
| 52 | if (class_exists('Symfony\Component\Config\Resource\FileResource')) { |
||
| 53 | $catalogue->addResource(new FileResource($resource)); |
||
| 54 | } |
||
| 55 | |||
| 56 | return $catalogue; |
||
| 57 | } |
||
| 58 | } |
||
| 59 |