[Cache] fix return type declarations

This commit is contained in:
Nicolas Grekas 2019-08-24 13:36:07 +02:00
parent 5072cfc7f8
commit 5f9aaa743c
2 changed files with 7 additions and 2 deletions

View File

@ -90,7 +90,7 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
*/
protected function doFlush()
{
$this->pool->clear();
return $this->pool->clear();
}
/**
@ -98,5 +98,6 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
*/
protected function doGetStats()
{
return null;
}
}

View File

@ -40,6 +40,10 @@ class MaxIdLengthAdapterTest extends TestCase
->setConstructorArgs([str_repeat('-', 26)])
->getMock();
$cache
->method('doFetch')
->willReturn(['2:']);
$reflectionClass = new \ReflectionClass(AbstractAdapter::class);
$reflectionMethod = $reflectionClass->getMethod('getId');
@ -56,7 +60,7 @@ class MaxIdLengthAdapterTest extends TestCase
$reflectionProperty->setValue($cache, true);
// Versioning enabled
$this->assertEquals('--------------------------:1:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]));
$this->assertEquals('--------------------------:2:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]));
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)])));
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 23)])));
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 40)])));