Optional symfony/yaml dependency
EmanueleMinotto opened this issue · 2 comments
symfony/yaml:^4.0
seems a too much strong requirement for me since the YamlDriver could be not used at all and the Yaml::parse
with content is accepted since symfony/yaml:^2.7
.
I would suggest this way:
- add to the composer.json a conflict with
symfony/yaml:<2.7
- move
symfony/yaml
fromrequire
torequire-dev
- implement the
Spatie\Snapshots\Drivers\YamlDriver::__construct
and throw an exception if the classSymfony\Component\Yaml\Yaml
doesn't exist
The same result as now should be obtained removing not really necessary contraints.
What do you think @freekmurze ? I would be happy to create a pull request if this looks good to you.
At this point I prefer to keep it simple and prefer the requirement on v4 of symfony components.
We don't use v2 anymore, so it doesn't make sense for us to invest time in this.
Thanks!
I don't want to maintain runtime checks for dependencies like suggested.
However, if someone has a real problem with the version constraint, ping back here and we'll look into loosening it.