[Yaml] Extract duplicate code to private function
[Yaml] Extract duplicate code to private function

symfony/symfony,nicolas-grekas/symfony,derrabus/symfony,derrabus/symfony,nicolas-grekas/symfony,symfony/symfony,derrabus/symfony,nicolas-grekas/symfony,nicolas-grekas/symfony,symfony/symfony,derrabus/symfony,symfony/symfony