$yaml = YamlPecl::
encode([$object]);
YamlSymfony::
decode($yaml);
} /**
* Data provider that lists all YAML files in core.
*/
public function providerYamlFilesInCore() { $files =
[];
$dirs =
new \
RecursiveIteratorIterator(new \
RecursiveDirectoryIterator(__DIR__ . '/../../../../../', \RecursiveDirectoryIterator::FOLLOW_SYMLINKS
));
foreach ($dirs as $dir) { $pathname =
$dir->
getPathname();
// Exclude core/node_modules.
if ($dir->
getExtension() == 'yml' && !
str_contains($pathname, '/../../../../../node_modules'
)) { if (str_contains($dir->
getRealPath(), 'invalid_file'
)) { // There are some intentionally invalid files provided for testing
// library API behaviors, ignore them.
continue;
} $files[] =
[$dir->
getRealPath()];
} } return $files;
}