[PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method
This commit is contained in:
parent
b92e4ed9d4
commit
9aac42698a
@ -1865,7 +1865,7 @@ class FrameworkExtension extends Extension
|
|||||||
|
|
||||||
if (!$container->getParameter('kernel.debug')) {
|
if (!$container->getParameter('kernel.debug')) {
|
||||||
$propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']);
|
$propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']);
|
||||||
$propertyAccessDefinition->setArguments([null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
|
$propertyAccessDefinition->setArguments([null, 0, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
|
||||||
$propertyAccessDefinition->addTag('cache.pool', ['clearer' => 'cache.system_clearer']);
|
$propertyAccessDefinition->addTag('cache.pool', ['clearer' => 'cache.system_clearer']);
|
||||||
$propertyAccessDefinition->addTag('monolog.logger', ['channel' => 'cache']);
|
$propertyAccessDefinition->addTag('monolog.logger', ['channel' => 'cache']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -828,6 +828,10 @@ class PropertyAccessor implements PropertyAccessorInterface
|
|||||||
*/
|
*/
|
||||||
public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
|
public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
|
||||||
{
|
{
|
||||||
|
if (null === $defaultLifetime) {
|
||||||
|
@trigger_error(sprintf('Passing null as "$defaultLifetime" 2nd argument of the "%s()" method is deprecated since Symfony 4.4, pass 0 instead.', __METHOD__), E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
|
||||||
if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
|
if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
|
||||||
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
|
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user