Skip to content

Commit 6730820

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: remove an invalid test [Translation] fix support of `TranslatableInterface` in `IdentityTranslator` Fix various bool-type coercions
2 parents ed4430f + 9d62453 commit 6730820

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ private function createService(Definition $definition, array &$inlineServices, b
11741174
if (!$definition->isDeprecated() && \is_array($factory) && \is_string($factory[0])) {
11751175
$r = new \ReflectionClass($factory[0]);
11761176

1177-
if (0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
1177+
if (0 < strpos($r->getDocComment() ?: '', "\n * @deprecated ")) {
11781178
trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" factory class. It should either be deprecated or its factory upgraded.', $id, $r->name);
11791179
}
11801180
}
@@ -1191,7 +1191,7 @@ private function createService(Definition $definition, array &$inlineServices, b
11911191
$service = $r->getConstructor() ? $r->newInstanceArgs($arguments) : $r->newInstance();
11921192
}
11931193

1194-
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
1194+
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment() ?: '', "\n * @deprecated ")) {
11951195
trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name);
11961196
}
11971197
}

Dumper/PhpDumper.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ private function collectLineage(string $class, array &$lineage): void
527527
return;
528528
}
529529
$file = $r->getFileName();
530-
if (str_ends_with($file, ') : eval()\'d code')) {
530+
if ($file && str_ends_with($file, ') : eval()\'d code')) {
531531
$file = substr($file, 0, strrpos($file, '(', -17));
532532
}
533533
if (!$file || $this->doExport($file) === $exportedFile = $this->export($file)) {
@@ -574,12 +574,13 @@ private function generateProxyClasses(): array
574574
continue;
575575
}
576576
do {
577-
$file = $r->getFileName();
578-
if (str_ends_with($file, ') : eval()\'d code')) {
579-
$file = substr($file, 0, strrpos($file, '(', -17));
580-
}
581-
if (is_file($file)) {
582-
$this->container->addResource(new FileResource($file));
577+
if ($file = $r->getFileName()) {
578+
if (str_ends_with($file, ') : eval()\'d code')) {
579+
$file = substr($file, 0, strrpos($file, '(', -17));
580+
}
581+
if (is_file($file)) {
582+
$this->container->addResource(new FileResource($file));
583+
}
583584
}
584585
$r = $r->getParentClass() ?: null;
585586
} while ($r?->isUserDefined());

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+
XmlUtils::phpize($call->getAttribute('returns-clone')) ?: false
346+
);
343347
}
344348

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

0 commit comments

Comments
 (0)