Skip to content

Instantly share code, notes, and snippets.

@ahoendgen
Last active December 4, 2019 14:55
Show Gist options
  • Save ahoendgen/0730e412db7f7c45e060042db7366902 to your computer and use it in GitHub Desktop.
Save ahoendgen/0730e412db7f7c45e060042db7366902 to your computer and use it in GitHub Desktop.
fix for symfony/yaml readable but for prettier broken yaml
<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$path = 'broken_but_readable.yaml';
$value = Yaml::parse(file_get_contents($path));
$yaml = Yaml::dump($value);
file_put_contents($path, $yaml);
//run prettier afterwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment