Skip to content

Commit a249be4

Browse files
committed
Definition::addMethodCall() arg 3 must be a bool v2
1 parent 93d90b6 commit a249be4

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
7070
$setters = $value->getMethodCalls();
7171
$value->setMethodCalls($withers);
7272
foreach ($setters as $call) {
73-
$value->addMethodCall($call[0], $call[1], $call[2] ?? false);
73+
$value->addMethodCall($call[0], $call[1], isset($call[2]));
7474
}
7575
}
7676

src/Symfony/Component/DependencyInjection/Definition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function setMethodCalls(array $calls = []): static
307307
{
308308
$this->calls = [];
309309
foreach ($calls as $call) {
310-
$this->addMethodCall($call[0], $call[1], $call[2] ?? false);
310+
$this->addMethodCall($call[0], $call[1], isset($call[2]));
311311
}
312312

313313
return $this;

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ private function parseDefinition(\DOMElement $service, string $file, Definition
339339
}
340340

341341
foreach ($this->getChildren($service, 'call') as $call) {
342-
$definition->addMethodCall($call->getAttribute('method'), $this->getArgumentsAsPhp($call, 'argument', $file), XmlUtils::phpize($call->getAttribute('returns-clone')));
342+
$definition->addMethodCall(
343+
$call->getAttribute('method'),
344+
$this->getArgumentsAsPhp($call, 'argument', $file),
345+
(bool) XmlUtils::phpize($call->getAttribute('returns-clone'))
346+
);
343347
}
344348

345349
$tags = $this->getChildren($service, 'tag');

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ private function parseDefinition(string $id, array|string|null $service, string
568568
if (isset($call['method']) && \is_string($call['method'])) {
569569
$method = $call['method'];
570570
$args = $call['arguments'] ?? [];
571-
$returnsClone = $call['returns_clone'] ?? false;
571+
$returnsClone = isset($call['returns_clone']);
572572
} else {
573573
if (1 === \count($call) && \is_string(key($call))) {
574574
$method = key($call);
@@ -589,7 +589,7 @@ private function parseDefinition(string $id, array|string|null $service, string
589589
} else {
590590
$method = $call[0];
591591
$args = $call[1] ?? [];
592-
$returnsClone = $call[2] ?? false;
592+
$returnsClone = isset($call[2]);
593593
}
594594
}
595595

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy