diff --git a/composer.json b/composer.json index 1ec51d1..66585af 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,6 @@ }, "require": { "php": ">=7.1", - "symfony/yaml": "^4|^3|^2" + "mustangostang/spyc": "^0.6.3" } } diff --git a/src/Config/Config.php b/src/Config/Config.php index 982d073..33c5987 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -1,9 +1,10 @@ get(null, $raw), 10); + return Spyc::YAMLDump($this->get(null, $raw), 2); } protected function read_ini($filename) @@ -65,7 +66,7 @@ class Config extends SelfReferencingFlatArray implements ConfigInterface protected function read_yaml($filename) { - return Yaml::parse(file_get_contents($filename)); + return Spyc::YAMLLoad($filename); } protected function read_yml($filename) diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php index cf04521..54edc70 100644 --- a/tests/Config/ConfigTest.php +++ b/tests/Config/ConfigTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Flatrr\Config; use PHPUnit\Framework\TestCase; -use Symfony\Component\Yaml\Yaml; +use Spyc; class ConfigTest extends TestCase { @@ -50,6 +50,6 @@ class ConfigTest extends TestCase //json $this->assertEquals($data, json_decode($c->json(), true)); //yaml - $this->assertEquals($data, Yaml::parse($c->yaml())); + $this->assertEquals($data, Spyc::YAMLLoad($c->yaml())); } }