Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] Add CacheItem::validateKey utility method#18597
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedApr 20, 2016
👍 |
…olas-grekas)This PR was merged into the 3.1-dev branch.Discussion----------[Cache] Add CacheItem::validateKey utility method| Q | A| ------------- | ---| Branch? | 3.1| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Ping@dunglasCommits-------af09cde [Cache] Add CacheItem::validateKey utility method
| } | ||
| privatefunctiongetId($key,$ns =false) | ||
| privatefunctiongetId($key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sorry for adding comments in a merged PR, but this was merged a bit quickly. I have some concerns about howvalidateKey() is used. It's a validator, but it's used like a getter or a normalizer.
Instead of this:
privatefunctiongetId($key){return$this->namespace.CacheItem::validateKey($key);}
Why not using it like this?
privatefunctiongetId($key){ CacheItem::validateKey($key);return$this->namespace.$key;}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This would just raise the boilerplate, whereas the current behavior keep it low IMHO.
Uh oh!
There was an error while loading.Please reload this page.
Ping@dunglas