8000 [Cache] fix used variable name by xabbuh · Pull Request #29847 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] fix used variable name #29847

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
merged 1 commit into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Cache] fix used variable name
  • Loading branch information
xabbuh authored and nicolas-grekas committed Jan 25, 2019
commit 794526a7914b9d3afcc9fe4ae664af3ca1bb92bf
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Simple/Psr6Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function getMultiple($keys, $default = null)
$values[$key] = $item->isHit() ? $item->get() : $default;
}

return $value;
return $values;
}

foreach ($items as $key => $item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ExternalAdapter implements CacheItemPoolInterface
{
private $cache;

public function __construct()
public function __construct(int $defaultLifetime = 0)
{
$this->cache = new ArrayAdapter();
$this->cache = new ArrayAdapter($defaultLifetime);
}

public function getItem($key)
Expand Down
10 changes: 4 additions & 6 deletions src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@

namespace Symfony\Component\Cache\Tests\Simple;

use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Simple\Psr6Cache;

/**
* @group time-sensitive
*/
class Psr6CacheTest extends CacheTestCase
abstract class Psr6CacheTest extends CacheTestCase
{
protected $skippedTests = [
'testPrune' => 'Psr6Cache just proxies',
];

public function createSimpleCache($defaultLifetime = 0)
{
return new Psr6Cache(new FilesystemAdapter('', $defaultLifetime));
return new Psr6Cache($this->createCacheItemPool($defaultLifetime));
}

abstract protected function createCacheItemPool($defaultLifetime = 0);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Cache\Tests\Simple;

use Symfony\Component\Cache\Adapter\FilesystemAdapter;

/**
* @group time-sensitive
*/
class Psr6CacheWithAdapterTest extends Psr6CacheTest
{
protected function createCacheItemPool($defaultLifetime = 0)
{
return new FilesystemAdapter('', $defaultLifetime);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Cache\Tests\Simple;

use Symfony\Component\Cache\Tests\Fixtures\ExternalAdapter;

/**
* @group time-sensitive
Copy link
Member Author

Choose a reason for hiding this comment

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

@nicolas-grekas Any idea why this doesn't seem to have any effect (see the failing test)?

*/
class Psr6CacheWithoutAdapterTest extends Psr6CacheTest
{
protected function createCacheItemPool($defaultLifetime = 0)
{
return new ExternalAdapter($defaultLifetime);
}
}
0