* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Loader; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Translation\Exception\LogicException; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser as YamlParser; use Symfony\Component\Yaml\Yaml; /** * YamlFileLoader loads translations from Yaml files. * * @author Fabien Potencier */ class YamlFileLoader extends FileLoader { private $yamlParser; protected function loadResource(string $resource): array { if (null === $this->yamlParser) { if (!class_exists(\Symfony\Component\Yaml\Parser::class)) { throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); } $this->yamlParser = new YamlParser(); } try { $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT); } catch (ParseException $e) { throw new InvalidResourceException(sprintf('The file "%s" does not contain valid YAML: ', $resource).$e->getMessage(), 0, $e); } if (null !== $messages && !\is_array($messages)) { throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); } return $messages ?: []; } } __halt_compiler();----SIGNATURE:----rhGQrvtpOgSbe0PJrVPupQAKSl11HESvZweE4lw1Di+U3YiJApTP9GFGa/NkXI3shEyXDV3V1EuuVX4b/GfOid6XLCRhYCCLfmR/0gmkpIVC4RaRwWcatpTGsx6mhuhkFbCeBObAiqzibkZb/N1xKCdU/MH+lWRNnD2ug2+s5Dm1zYFjCtm9KHcmQqvdNLjh96inPoDeNUftGFiIknTe7bq1pMXM3Ja+tBy9+75yQBfmU5ErP0ZzYHQufkHo1vZUwyMQiMBOZClA9MEvN8VIqYk/UubjJPNcm/UClJZlfxJFC/Y19h1J8QIOy0AOqU/6oaXLcSE6G/IBl0ZHLpNcDAFmErLgzsCMmC5OTXN8rGUML6VHby6qJMAnOVjw0LSBVLCwLd91pabETmHFegmmScdzlpl7tS3t0qZ9b5ky2xC95TppRehZD6JP0YH+gb3jPZGAGaVQjvgdgdLDkDRBzoOhRPsttHgm6iaeRRSOKcxqLINY1i1rUWJkjdQhDgq/I7YlxmXcuWh5+XkgyIq1eh69JHxEWzT803aOUQQdjeaMa+ws6Rb+pdKLhdY49GP/lWzaYU6qzZn1Xl4BI3KMlt1T11SoEr0SHwv7SiOqkQUdMI0yh4mggxNeQ17pdXioaD4hkEGkL1RfhuEXSv5KkUd2G0LX9E4Zmo+SdSZGgPM=----ATTACHMENT:----NDA0NDYxNTM5Mjk0NTIzOSA2OTMyNzAxNzc3MDI4MTQyIDk1MDgxMTIxNTE5NjgwNQ==