Skip to content

Commit f7d8911

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [Validator] Fix return types Add translation for Belarusian fix parsing calls of methods named "method" deal with indented heredoc/nowdoc tokens Adding templates for Belarusian
2 parents 0afb2cb + 4b3e341 commit f7d8911

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ private function parseDefinition(string $id, $service, string $file, array $defa
522522
throw new InvalidArgumentException(sprintf('Invalid method call for service "%s", did you forgot a leading dash before "%s: ..." in "%s"?', $id, $k, $file));
523523
}
524524

525-
if (isset($call['method'])) {
525+
if (isset($call['method']) && \is_string($call['method'])) {
526526
$method = $call['method'];
527527
$args = $call['arguments'] ?? [];
528528
$returnsClone = $call['returns_clone'] ?? false;

Tests/Fixtures/yaml/alt_call.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ services:
33
calls:
44
- foo: [1, 2, 3]
55
- bar: !returns_clone [1, 2, 3]
6+
- method:
7+
- url

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ public function testAlternativeMethodCalls()
958958
$expected = [
959959
['foo', [1, 2, 3]],
960960
['bar', [1, 2, 3], true],
961+
['method', ['url']],
961962
];
962963

963964
$this->assertSame($expected, $container->getDefinition('foo')->getMethodCalls());

0 commit comments

Comments
 (0)