schmittjoh / serializer

Library for (de-)serializing data of any complexity (supports JSON, and XML)
http://jmsyst.com/libs/serializer
MIT License
2.32k stars 588 forks source link

Don't use the `FilesystemCache` class if it doesn't exist #1447

Closed derrabus closed 1 year ago

derrabus commented 1 year ago
Q A
Bug fix? yes
New feature? no
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets https://github.com/schmittjoh/serializer/pull/1445#issuecomment-1368456236
License MIT

If Symfony Cache is not installed and the Doctrine Cache package is installed in version 2, we effectively cannot produce a cached annotation reader. Right now, we would run into an error because SerializerBuilder would attempt to create an instance of FilesystemCache which doesn't exist anymore.

With the proposed change, we would silently fall back to an uncached reader which might just be good enough. The alternative would be to throw an exception, telling the caller to either install Symfony Cache or turn off caching.

derrabus commented 1 year ago

Scrutinizer seems to have problems downloading packages from GitHub. Should be unrelated to this PR.