Mark Cache dependencies as optional
None of the actual Cache usages are required, as they are checked by runtime if exist:
- https://github.com/doctrine-extensions/DoctrineExtensions/blob/2def628a9a8304c1e7f56847a0b21778a3a9ed61/src/DoctrineExtensions.php#L119-L123
- https://github.com/doctrine-extensions/DoctrineExtensions/blob/2def628a9a8304c1e7f56847a0b21778a3a9ed61/src/Tree/Strategy/ORM/Closure.php#L197-L200
Marking those as optional allow to get rid of unused (an thus unwanted) dependencies.
Codecov Report
Merging #2425 (d1d8f93) into main (2def628) will decrease coverage by
0.13%. The diff coverage isn/a.
@@ Coverage Diff @@
## main #2425 +/- ##
============================================
- Coverage 80.10% 79.97% -0.14%
+ Complexity 3161 3128 -33
============================================
Files 159 158 -1
Lines 8198 7670 -528
============================================
- Hits 6567 6134 -433
+ Misses 1631 1536 -95
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...ble/Document/MappedSuperclass/AbstractLogEntry.php | 80.00% <0.00%> (-3.79%) |
:arrow_down: |
| src/Timestampable/Mapping/Driver/Yaml.php | 75.00% <0.00%> (-3.58%) |
:arrow_down: |
| ...gable/Entity/MappedSuperclass/AbstractLogEntry.php | 86.66% <0.00%> (-2.53%) |
:arrow_down: |
| src/SoftDeleteable/Mapping/Validator.php | 83.33% <0.00%> (-2.39%) |
:arrow_down: |
| src/Timestampable/Mapping/Driver/Xml.php | 84.00% <0.00%> (-2.21%) |
:arrow_down: |
| .../Sluggable/Handler/InversedRelativeSlugHandler.php | 85.71% <0.00%> (-2.05%) |
:arrow_down: |
| ...ment/MongoDB/Repository/AbstractTreeRepository.php | 68.96% <0.00%> (-2.01%) |
:arrow_down: |
| src/IpTraceable/Mapping/Driver/Annotation.php | 75.00% <0.00%> (-1.93%) |
:arrow_down: |
| src/Mapping/Driver/AttributeAnnotationReader.php | 48.14% <0.00%> (-1.86%) |
:arrow_down: |
| src/Translator/Translation.php | 88.23% <0.00%> (-1.77%) |
:arrow_down: |
| ... and 107 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 2def628...d1d8f93. Read the comment docs.
There is another usage (it was defined as required because of this):
https://github.com/doctrine-extensions/DoctrineExtensions/blob/ddc468bcf40045a5b1606f62296b75c7c2a6a42c/src/Mapping/MappedEventSubscriber.php#L283-L301
You're right: we still can mark symfony/cache as optional, and throw an Exception if both are absent.
I'll update the PR as soon as possible
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Huh, I completely forgot to update this PR :open_mouth:
@franmomu rebased and updated as requested
Also ping @phansys as I've just seen this comment: https://github.com/doctrine-extensions/DoctrineExtensions/pull/2564#issuecomment-1370155413
I guess we can merge this PR before the new release, as it is not narrowing an existing dependency or adding new ones. :+1: