Skip to content

[Validator] Deprecated CacheInterface in favor of PSR-6 #33459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Sep 4, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #33414
License MIT
Doc PR symfony/symfony-docs#12276

With PSR-6, the validator component does not need its own CacheInterface, so let's remove it.

Note that I still use the now deprecated Psr6Cache class to keep the logic inside LazyLoadingMetadataFactory simple. My plan would be to inline all logic from Psr6Cache into LazyLoadingMetadataFactory for 5.0.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be great to not use Psr6Cache if possible: we usually try to make the code as close as possible to the target (v5 here)

@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch 2 times, most recently from 8a59e7d to 6d09ea3 Compare September 4, 2019 18:35
@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch 2 times, most recently from 7e0a2b3 to 4657cff Compare September 4, 2019 18:47
@derrabus
Copy link
Member Author

derrabus commented Sep 4, 2019

it'd be great to not use Psr6Cache if possible: we usually try to make the code as close as possible to the target (v5 here)

All right, I've inlined Psr6Cache with this PR already.

@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch 3 times, most recently from fbadf44 to 8a200c0 Compare September 4, 2019 19:13
@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch from 8a200c0 to bfe8ccc Compare September 5, 2019 12:04
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What started as a refactoring task might now be a performance improvement. smiley

Removing code and improving perf. There need to be a reason why we annoy users with deprecations, this is a good one :)

@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch from bfe8ccc to b335ffb Compare September 5, 2019 12:13
@derrabus derrabus force-pushed the improvement/deprecate-validator-cache branch from b335ffb to 0b08040 Compare September 5, 2019 12:29
@nicolas-grekas
Copy link
Member

Thank you @derrabus.

nicolas-grekas added a commit that referenced this pull request Sep 5, 2019
…6 (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Deprecated CacheInterface in favor of PSR-6

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #33414
| License       | MIT
| Doc PR        | TODO

With PSR-6, the validator component does not need its own `CacheInterface`, so let's remove it.

Note that I still use the now deprecated `Psr6Cache` class to keep the logic inside `LazyLoadingMetadataFactory` simple. My plan would be to inline all logic from `Psr6Cache` into `LazyLoadingMetadataFactory` for 5.0.

Commits
-------

0b08040 [Validator] Deprecated CacheInterface in favor of PSR-6.
@nicolas-grekas nicolas-grekas merged commit 0b08040 into symfony:4.4 Sep 5, 2019
@derrabus derrabus deleted the improvement/deprecate-validator-cache branch September 5, 2019 12:37
nicolas-grekas added a commit that referenced this pull request Sep 5, 2019
…rrabus)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[Validator] Removed CacheInterface in favor of PSR-6

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33414
| License       | MIT
| Doc PR        | symfony/symfony-docs#12276

This PR removes the deprecation layer of #33459.

Commits
-------

34b141c [Validator] Removed CacheInterface in favor of PSR-6.
nicolas-grekas added a commit that referenced this pull request Sep 5, 2019
…errabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Update "suggest" section in composer.json

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

After #33459, the composer suggestions for the validator component are a bit misleading. Sorry for having missed that in my PR.

Commits
-------

5bf8cca [Validator] Update "suggest" section in composer.json.
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Sep 6, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

Document the validator's switch to PSR-6

This PR documents symfony/symfony#33459 and fixes #12275.

Commits
-------

2f010b7 Document the validator's switch to PSR-6.
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants