Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0ea84b

Browse filesBrowse files
bug #29847 [Cache] fix used variable name (xabbuh)
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] fix used variable name | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29843 | License | MIT | Doc PR | Commits ------- 794526a [Cache] fix used variable name
2 parents 25f9ec6 + 794526a commit a0ea84b
Copy full SHA for a0ea84b

File tree

Expand file treeCollapse file tree

5 files changed

+57
-9
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+57
-9
lines changed

‎src/Symfony/Component/Cache/Simple/Psr6Cache.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Simple/Psr6Cache.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function getMultiple($keys, $default = null)
154154
$values[$key] = $item->isHit() ? $item->get() : $default;
155155
}
156156

157-
return $value;
157+
return $values;
158158
}
159159

160160
foreach ($items as $key => $item) {

‎src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class ExternalAdapter implements CacheItemPoolInterface
2424
{
2525
private $cache;
2626

27-
public function __construct()
27+
public function __construct(int $defaultLifetime = 0)
2828
{
29-
$this->cache = new ArrayAdapter();
29+
$this->cache = new ArrayAdapter($defaultLifetime);
3030
}
3131

3232
public function getItem($key)

‎src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14-
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1514
use Symfony\Component\Cache\Simple\Psr6Cache;
1615

17-
/**
18-
* @group time-sensitive
19-
*/
20-
class Psr6CacheTest extends CacheTestCase
16+
abstract class Psr6CacheTest extends CacheTestCase
2117
{
2218
protected $skippedTests = [
2319
'testPrune' => 'Psr6Cache just proxies',
2420
];
2521

2622
public function createSimpleCache($defaultLifetime = 0)
2723
{
28-
return new Psr6Cache(new FilesystemAdapter('', $defaultLifetime));
24+
return new Psr6Cache($this->createCacheItemPool($defaultLifetime));
2925
}
26+
27+
abstract protected function createCacheItemPool($defaultLifetime = 0);
3028
}
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Tests\Simple;
13+
14+
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
15+
16+
/**
17+
* @group time-sensitive
18+
*/
19+
class Psr6CacheWithAdapterTest extends Psr6CacheTest
20+
{
21+
protected function createCacheItemPool($defaultLifetime = 0)
22+
{
23+
return new FilesystemAdapter('', $defaultLifetime);
24+
}
25+
}
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Tests\Simple;
13+
14+
use Symfony\Component\Cache\Tests\Fixtures\ExternalAdapter;
15+
16+
/**
17+
* @group time-sensitive
18+
*/
19+
class Psr6CacheWithoutAdapterTest extends Psr6CacheTest
20+
{
21+
protected function createCacheItemPool($defaultLifetime = 0)
22+
{
23+
return new ExternalAdapter($defaultLifetime);
24+
}
25+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.