[Validator] Add a PSR-6 adapter#17440
Conversation
dunglas
commented
Jan 19, 2016
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | n/a |
| License | MIT |
| Doc PR | todo |
|
Ok I did not see your PR before I started working on mine ;P Closing mine as this looks very similar 👍 |
There was a problem hiding this comment.
simply use return $this->cacheItemPool->hasItem($this->escapeClassName($class)); ?
There was a problem hiding this comment.
According to the PSR-6, hasItem can in be unreliable:
* Note: This method MAY avoid retrieving the cached value for performance reasons.
* This could result in a race condition with CacheItemInterface::get(). To avoid
* such situation use CacheItemInterface::isHit() instead.
It looks better to me to keep it as is.
There was a problem hiding this comment.
Performance doesn't matter here, the metadata caching occurs at "compile" time.
There was a problem hiding this comment.
|
@dunglas Can you finish this one? |
|
Should be ok now. |
|
Thank you @dunglas. |
There was a problem hiding this comment.
we normalized this sort of operations to str_replace before
This PR was merged into the 3.1-dev branch. Discussion ---------- [Validator] Minor fixes for the PSR-6 adapter | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | todo Follows #17440. Take into account comments of @Tobion. Commits ------- aa60d5b [Validator] Minor fixes for the PSR-6 adapter