Skip to content

Commit 36481ae

Browse files
committed
bug #40313 [FrameworkBundle] Fix PropertyAccess definition when not in debug (PedroTroller)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Fix PropertyAccess definition when not in debug | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT The signature of the `PropertyAccessor::createCache()` method specifies that the first argument must be a string but in the `FameworkBundle` configures its DIC with a first argument to `null`. Replacing `null` by `''` allows to respect the contact of `PropertyAccessor::createCache()` and removes the following error when the `symfony/framework-bundle` is blocked in `4.4` but the symfony/property-access goes up to `5.2`. ``` Argument 3 passed to Symfony\Component\PropertyAccess\PropertyAccessor::createCache() must be of the type string, null given, called in /usr/src/app/var/cache/prod/ContainerDX7KWI4/getCache_PropertyAccessService.php on line 12 ``` Commits ------- 116c54a554 Fix FrameworkBundle PropertyAccess definition when not in debug
2 parents f8a861f + fb10eec commit 36481ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
19831983

19841984
if (!$container->getParameter('kernel.debug')) {
19851985
$propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']);
1986-
$propertyAccessDefinition->setArguments([null, 0, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
1986+
$propertyAccessDefinition->setArguments(['', 0, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]);
19871987
$propertyAccessDefinition->addTag('cache.pool', ['clearer' => 'cache.system_clearer']);
19881988
$propertyAccessDefinition->addTag('monolog.logger', ['channel' => 'cache']);
19891989
} else {

0 commit comments

Comments
 (0)