dump($data, PHP_INT_MAX, 0, SymfonyYaml::DUMP_EXCEPTION_ON_INVALID_TYPE); } catch (\Exception $e) { throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e); } } /** * {@inheritdoc} */ public static function decode($raw) { try { $yaml = new Parser(); // Make sure we have a single trailing newline. A very simple config like // 'foo: bar' with no newline will fail to parse otherwise. return $yaml->parse($raw, SymfonyYaml::PARSE_EXCEPTION_ON_INVALID_TYPE); } catch (\Exception $e) { throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e); } } /** * {@inheritdoc} */ public static function getFileExtension() { return 'yml'; } }