mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-calendar-module.git
synced 2026-07-15 16:08:35 +08:00
620 B
620 B
Sometimes the handling of dataypes in other libraries can be confusing
Example from Symfony Yaml
$object = new \stdClass();
$object->foo = 'bar';
$dumped = Yaml::dump(['data' => $object], 2, 4, Yaml::DUMP_OBJECT_AS_MAP);
// $dumped = "data:\n foo: bar"
Dallgoot\Yaml removes this ambiguity by matching a specific PHP data types with its YAML counterpart like so :
- PHP standard objects -> YAML mapping
- PHP standard array -> YAML sequence
- Dallgoot\Types\Compact -> YAML mapping or sequence according to content
- Dallgoot\Types\YamlObject -> YAML mapping or sequence according to content