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 3644b70

Browse filesBrowse files
committed
feature #32241 [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method (jschaedl)
This PR was squashed before being merged into the 4.4 branch (closes #32241). Discussion ---------- [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A<!-- required for new features --> This PR is related to #32234 (comment) Commits ------- 9aac426 [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method
2 parents 905c863 + 9aac426 commit 3644b70
Copy full SHA for 3644b70

File tree

2 files changed

+5
-1
lines changed
Filter options

2 files changed

+5
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
18691869

18701870
if (!$container->getParameter('kernel.debug')) {
18711871
$propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']);
1872-
$propertyAccessDefinition->setArguments([null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
1872+
$propertyAccessDefinition->setArguments([null, 0, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
18731873
$propertyAccessDefinition->addTag('cache.pool', ['clearer' => 'cache.system_clearer']);
18741874
$propertyAccessDefinition->addTag('monolog.logger', ['channel' => 'cache']);
18751875
} else {

‎src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/PropertyAccessor.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,10 @@ private function getPropertyPath($propertyPath): PropertyPath
828828
*/
829829
public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
830830
{
831+
if (null === $defaultLifetime) {
832+
@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);
833+
}
834+
831835
if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
832836
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
833837
}

0 commit comments

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