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

Always pass $key to NullAdapter->createCacheItem #29794

Merged
merged 1 commit into from Jan 25, 2019

Conversation

Projects
None yet
4 participants
@TysonAndre
Copy link
Contributor

TysonAndre commented Jan 5, 2019

Q A
Branch? 4.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes (build failure seems unrelated)
Fixed tickets
License MIT
Doc PR

Previously, if this were called, it would throw an ArgumentCountError.
I'm assuming existing code always checks hasItem, so this bug hasn't impacted many people.
This was noticed via static analysis.

The get() method was added to NullAdapter in symfony 4.2

@TysonAndre

This comment has been minimized.

Copy link
Contributor Author

TysonAndre commented Jan 5, 2019

code to reproduce:

<?php
require_once 'vendor/autoload.php';
$x = new Symfony\Component\Cache\Adapter\NullAdapter();
var_export($x->get('key', function (...$args) {}));  // would throw ArgumentCountError
Always pass $key to NullAdapter->createCacheItem
Previously, if this were called, it would throw an ArgumentCountError.
I'm assuming existing code always checks hasItem, so this bug hasn't impacted many people.
This was noticed via static analysis.

The get() method was added to NullAdapter in symfony 4.2

@TysonAndre TysonAndre force-pushed the TysonAndre:patch-1 branch from 1408f33 to 1976d29 Jan 5, 2019

@chalasr chalasr added this to the 4.2 milestone Jan 5, 2019

@chalasr chalasr added the Cache label Jan 5, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Jan 25, 2019

Good catch, thanks @TysonAndre.

@nicolas-grekas nicolas-grekas merged commit 1976d29 into symfony:4.2 Jan 25, 2019

0 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
fabbot.io Some changes should be done to comply with our standards.
Details

nicolas-grekas added a commit that referenced this pull request Jan 25, 2019

bug #29794 Always pass $key to NullAdapter->createCacheItem (TysonAndre)
This PR was merged into the 4.2 branch.

Discussion
----------

Always pass $key to NullAdapter->createCacheItem

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes (build failure seems unrelated)
| Fixed tickets |
| License       | MIT
| Doc PR        |

Previously, if this were called, it would throw an ArgumentCountError.
I'm assuming existing code always checks hasItem, so this bug hasn't impacted many people.
This was noticed via static analysis.

The get() method was added to NullAdapter in symfony 4.2

Commits
-------

1976d29 Always pass $key to NullAdapter->createCacheItem

@fabpot fabpot referenced this pull request Feb 3, 2019

Merged

Release v4.2.3 #30068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment