8000 bug #40386 [DependencyInjection][Security] Backport psr/container 1.1… · symfony/symfony@869c734 · GitHub
[go: up one dir, main page]

Skip to content

Commit 869c734

Browse files
committed
bug #40386 [DependencyInjection][Security] Backport psr/container 1.1/2.0 compatibility (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection][Security] Backport psr/container 1.1/2.0 compatibility | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix https://github.com/symfony/symfony/pull/40384/files#r588494278 | License | MIT | Doc PR | N/A This PR backports a fix that I had to apply to the 5.x branch in order to make it compatible with the `psr/container` 1.1 interfaces. It also updates various composer.json files: * Security Core only consumes a PSR `ContainerInterface` without providing its own implementation. I should be compatible with version 2 of the PSR package already. * ~~DependencyInjection breaks on PHP 7.2 and 7.3 if `psr/container` 1.1.0 is installed. A version 1.1.1 has already been release that fixes the issue. I've added a conflict rule to document the incompatibility.~~ Commits ------- 7f8242e Backport psr/container 1.1/2.0 compatibility
2 parents 2536e17 + 7f8242e commit 869c734

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot):
146146
$this->decoratedClass = null;
147147
$this->getPreviousValue = null;
148148

149-
if ($isRoot && ($definition = $this->container->getDefinition($this->currentId)) && $this->container->has($this->decoratedId = $definition->innerServiceId)) {
149+
if ($isRoot && ($definition = $this->container->getDefinition($this->currentId)) && null !== ($this->decoratedId = $definition->innerServiceId) && $this->container->has($this->decoratedId)) {
150150
$this->decoratedClass = $this->container->findDefinition($this->decoratedId)->getClass();
151151
}
152152

src/Symfony/Component/Security/Core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/service-contracts": "^1.1.6|^2"
2222
},
2323
"require-dev": {
24-
"psr/container": "^1.0",
24+
"psr/container": "^1.0|^2.0",
2525
"symfony/event-dispatcher": "^4.3",
2626
"symfony/expression-language": "^3.4|^4.0|^5.0",
2727
"symfony/http-foundation": "^3.4|^4.0|^5.0",

src/Symfony/Component/Security/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"symfony/security-http": "self.version"
3131
},
3232
"require-dev": {
33-
"psr/container": "^1.0",
33+
"psr/container": "^1.0|^2.0",
3434
"symfony/finder": "^3.4|^4.0|^5.0",
3535
"symfony/polyfill-ctype": "~1.8",
3636
"symfony/polyfill-intl-icu": "~1.0",

0 commit comments

Comments
 (0)
0