10000 Merge branch '3.4' into 4.3 · dunglas/symfony@6d5c91b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d5c91b

Browse files
Merge branch '3.4' into 4.3
* 3.4: symfony#30432 fix an error message fix paths to detect code owners [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 Remove unused local variables in tests Make sure to collect child forms created on *_SET_DATA events do not render errors for checkboxes twice
2 parents 48533ff + 8920672 commit 6d5c91b

File tree

75 files changed

+223
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+223
-143
lines changed

.github/CODEOWNERS

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php @dunglas
55
# Form
66
/src/Symfony/Bridge/Twig/Extension/FormExtension.php @xabbuh
7-
/src/Symfony/Bridge/Twig/Form/* @xabbuh
7+
/src/Symfony/Bridge/Twig/Form/ @xabbuh
88
/src/Symfony/Bridge/Twig/Node/FormThemeNode.php @xabbuh
99
/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php @xabbuh
1010
/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php @xabbuh
@@ -13,34 +13,34 @@
1313
/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php @xabbuh
1414
/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php @xabbuh
1515
/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php @xabbuh
16-
/src/Symfony/Bundle/FrameworkBundle/Resources/views/* @xabbuh
16+
/src/Symfony/Bundle/FrameworkBundle/Resources/views/ @xabbuh
1717
/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php @xabbuh
1818
/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php @xabbuh
1919
/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @xabbuh
2020
/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @xabbuh
21-
/src/Symfony/Component/Form/* @xabbuh
21+
/src/Symfony/Component/Form/ @xabbuh
2222
# HttpKernel
2323
/src/Symfony/Component/HttpKernel/Log/Logger.php @dunglas
2424
# LDAP
25-
/src/Symfony/Component/Ldap/* @csarrazi
25+
/src/Symfony/Component/Ldap/ @csarrazi
2626
# Lock
27-
/src/Symfony/Component/Lock/* @jderusse
27+
/src/Symfony/Component/Lock/ @jderusse
2828
# Messenger
29-
/src/Symfony/Bridge/Doctrine/Messenger/* @sroze
30-
/src/Symfony/Component/Messenger/* @sroze
29+
/src/Symfony/Bridge/Doctrine/Messenger/ @sroze
30+
/src/Symfony/Component/Messenger/ @sroze
3131
# PropertyInfo
32-
/src/Symfony/Component/PropertyInfo/* @dunglas
33-
/src/Symfony/Bridge/Doctrine/PropertyInfo/* @dunglas
32+
/src/Symfony/Component/PropertyInfo/ @dunglas
33+
/src/Symfony/Bridge/Doctrine/PropertyInfo/ @dunglas
3434
# Serializer
35-
/src/Symfony/Component/Serializer/* @dunglas
35+
/src/Symfony/Component/Serializer/ @dunglas
3636
# WebLink
37-
/src/Symfony/Component/WebLink/* @dunglas
37+
/src/Symfony/Component/WebLink/ @dunglas
3838
# Workflow
3939
/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php @lyrixx
4040
/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php @lyrixx
4141
/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @lyrixx
4242
/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php @lyrixx
4343
/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php @lyrixx
44-
/src/Symfony/Component/Workflow/* @lyrixx
44+
/src/Symfony/Component/Workflow/ @lyrixx
4545
# Yaml
46-
/src/Symfony/Component/Yaml/* @xabbuh
46+
/src/Symfony/Component/Yaml/ @xabbuh

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder()
187187
public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure()
188188
{
189189
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
190-
$field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
190+
$this->factory->createNamed('name', static::TESTED_TYPE, null, [
191191
'em' => 'default',
192192
'class' => self::SINGLE_IDENT_CLASS,
193193
'query_builder' => new \stdClass(),

src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function compile(Compiler $compiler)
2828

2929
preg_match('/_([^_]+)$/', $this->getAttribute('name'), $matches);
3030

31-
$label = null;
3231
$arguments = iterator_to_array($this->getNode('arguments'));
3332
$blockNameSuffix = $matches[1];
3433

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_horizontal_layout.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ col-sm-10
8282
<div class="{{ block('form_group_class') }}">
8383
{{- form_widget(form) -}}
8484
{{- form_help(form) -}}
85-
{{- form_errors(form) -}}
8685
</div>{#--#}
8786
</div>
8887
{%- endblock checkbox_row %}

src/Symfony/Bridge/Twig/Tests/AppVariableTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ public function testGetFlashes()
180180
$flashMessages = $this->setFlashMessages();
181181
$this->assertEquals($flashMessages, $this->appVariable->getFlashes([]));
182182

183-
$flashMessages = $this->setFlashMessages();
183+
$this->setFlashMessages();
184184
$this->assertEquals([], $this->appVariable->getFlashes('this-does-not-exist'));
185185

186-
$flashMessages = $this->setFlashMessages();
186+
$this->setFlashMessages();
187187
$this->assertEquals(
188188
['this-does-not-exist' => []],
189189
$this->appVariable->getFlashes(['this-does-not-exist'])

src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testLintFileNotReadable()
5252
$filename = $this->createFile('');
5353
unlink($filename);
5454

55-
$ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]);
55+
$tester->execute(['filename' => [$filename]], ['decorated' => false]);
5656
}
5757

5858
public function testLintFileCompileTimeException()

src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testTiming($template, $events)
3434
$twig->addExtension(new StopwatchExtension($this->getStopwatch($events)));
3535

3636
try {
37-
$nodes = $twig->render('template');
37+
$twig->render('template');
3838
} catch (RuntimeError $e) {
3939
throw $e->getPrevious();
4040
}

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ public function testTransUnknownKeyword()
5858
{
5959
$this->expectException('Twig\Error\SyntaxError');
6060
$this->expectExceptionMessage('Unexpected token. Twig was looking for the "with", "from", or "into" keyword in "index" at line 3.');
61-
$output = $this->getTemplate("{% trans \n\nfoo %}{% endtrans %}")->render();
61+
$this->getTemplate("{% trans \n\nfoo %}{% endtrans %}")->render();
6262
}
6363

6464
public function testTransComplexBody()
6565
{
6666
$this->expectException('Twig\Error\SyntaxError');
6767
$this->expectExceptionMessage('A message inside a trans tag must be a simple text in "index" at line 2.');
68-
$output = $this->getTemplate("{% trans %}\n{{ 1 + 2 }}{% endtrans %}")->render();
68+
$this->getTemplate("{% trans %}\n{{ 1 + 2 }}{% endtrans %}")->render();
6969
}
7070

7171
/**
@@ -75,7 +75,7 @@ public function testTransChoiceComplexBody()
7575
{
7676
$this->expectException('Twig\Error\SyntaxError');
7777
$this->expectExceptionMessage('A message inside a transchoice tag must be a simple text in "index" at line 2.');
78-
$output = $this->getTemplate("{% transchoice count %}\n{{ 1 + 2 }}{% endtranschoice %}")->render();
78+
$this->getTemplate("{% transchoice count %}\n{{ 1 + 2 }}{% endtranschoice %}")->render();
7979
}
8080

8181
public function getTransTests()

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ private function renderEventListenerTable(EventDispatcherInterface $eventDispatc
508508
$tableHeaders = ['Order', 'Callable', 'Priority'];
509509
$tableRows = [];
510510

511-
$order = 1;
512511
foreach ($eventListeners as $order => $listener) {
513512
$tableRows[] = [sprintf('#%d', $order + 1), $this->formatCallable($listener), $eventDispatcher->getListenerPriority($event, $listener)];
514513
}

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ public function testFileWhichDoesNotExist()
277277
$this->expectException('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException');
278278
$controller = $this->createController();
279279

280-
/* @var BinaryFileResponse $response */
281-
$response = $controller->file('some-file.txt', 'test.php');
280+
$controller->file('some-file.txt', 'test.php');
282281
}
283282

284283
public function testIsGranted()

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TestExtension extends Extension implements PrependExtensionInterface
2626
public function load(array $configs, ContainerBuilder $container)
2727
{
2828
$configuration = $this->getConfiguration($configs, $container);
29-
$config = $this->processConfiguration($configuration, $configs);
29+
$this->processConfiguration($configuration, $configs);
3030

3131
$container->setAlias('test.annotation_reader', new Alias('annotation_reader', true));
3232
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testFlash($config, $insulate)
5959
}
6060

6161
// set flash
62-
$crawler = $client->request('GET', '/session_setflash/Hello%20world.');
62+
$client->request('GET', '/session_setflash/Hello%20world.');
6363

6464
// check flash displays on redirect
6565
$this->assertStringContainsString('Hello world.', $client->followRedirect()->text());

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testDefaultFailureHandler($serviceId, $defaultHandlerInjection)
6161
$options['failure_handler'] = $serviceId;
6262
}
6363

64-
list($container, $authProviderId, $listenerId, $entryPointId) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
64+
list($container) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
6565

6666
$definition = $container->getDefinition('abstract_listener.foo');
6767
$arguments = $definition->getArguments();
@@ -99,7 +99,7 @@ public function testDefaultSuccessHandler($serviceId, $defaultHandlerInjection)
9999
$options['success_handler'] = $serviceId;
100100
}
101101

102-
list($container, $authProviderId, $listenerId, $entryPointId) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
102+
list($container) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
103103

104104
$definition = $container->getDefinition('abstract_listener.foo');
105105
$arguments = $definition->getArguments();

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function testCreateWithEntryPoint()
159159
'authenticators' => ['authenticator123', 'authenticatorABC'],
160160
'entry_point' => 'authenticatorABC',
161161
];
162-
list($container, $entryPointId) = $this->executeCreate($config, null);
162+
list(, $entryPointId) = $this->executeCreate($config, null);
163163
$this->assertEquals('authenticatorABC', $entryPointId);
164164
}
165165

@@ -172,7 +172,7 @@ private function executeCreate(array $config, $defaultEntryPointId)
172172
$userProviderId = 'my_user_provider';
173173

174174
$factory = new GuardAuthenticationFactory();
175-
list($providerId, $listenerId, $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
175+
list(, , $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
176176

177177
return [$container, $entryPointId];
178178
}

src/Symfony/Component/BrowserKit/Tests/CookieTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function testConstructException()
201201
{
202202
$this->expectException('UnexpectedValueException');
203203
$this->expectExceptionMessage('The cookie expiration time "string" is not valid.');
204-
$cookie = new Cookie('foo', 'bar', 'string');
204+
new Cookie('foo', 'bar', 'string');
205205
}
206206

207207
public function testSameSite()

src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testTooLongNamespace()
7070
{
7171
$this->expectException('Symfony\Component\Cache\Exception\InvalidArgumentException');
7272
$this->expectExceptionMessage('Namespace must be 26 chars max, 40 given ("----------------------------------------")');
73-
$cache = $this->getMockBuilder(MaxIdLengthAdapter::class)
73+
$this->getMockBuilder(MaxIdLengthAdapter::class)
7474
->setConstructorArgs([str_repeat('-', 40)])
7575
->getMock();
7676
}

src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DelegatingLoaderTest extends TestCase
1919
{
2020
public function testConstructor()
2121
{
22-
$loader = new DelegatingLoader($resolver = new LoaderResolver());
22+
new DelegatingLoader($resolver = new LoaderResolver());
2323
$this->assertTrue(true, '__construct() takes a loader resolver as its first argument');
2424
}
2525

src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testExistsKo()
6767

6868
$loadedClass = 123;
6969

70-
$res = new ClassExistenceResource('MissingFooClass', false);
70+
new ClassExistenceResource('MissingFooClass', false);
7171

7272
$this->assertSame(123, $loadedClass);
7373
} finally {

src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testResourceDoesNotExist()
6767
{
6868
$this->expectException('InvalidArgumentException');
6969
$this->expectExceptionMessageRegExp('/The directory ".*" does not exist./');
70-
$resource = new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
70+
new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
7171
}
7272

7373
public function testIsFresh()
@@ -165,7 +165,7 @@ public function testSerializeUnserialize()
165165
{
166166
$resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
167167

168-
$unserialized = unserialize(serialize($resource));
168+
unserialize(serialize($resource));
169169

170170
$this->assertSame(realpath($this->directory), $resource->getResource());
171171
$this->assertSame('/\.(foo|xml)$/', $resource->getPattern());

src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testResourceDoesNotExist()
5757
{
5858
$this->expectException('InvalidArgumentException');
5959
$this->expectExceptionMessageRegExp('/The file ".*" does not exist./');
60-
$resource = new FileResource('/____foo/foobar'.mt_rand(1, 999999));
60+
new FileResource('/____foo/foobar'.mt_rand(1, 999999));
6161
}
6262

6363
public function testIsFresh()
@@ -76,7 +76,7 @@ public function testIsFreshForDeletedResources()
7676

7777
public function testSerializeUnserialize()
7878
{
79-
$unserialized = unserialize(serialize($this->resource));
79+
unserialize(serialize($this->resource));
8080

8181
$this->assertSame(realpath($this->file), $this->resource->getResource());
8282
}

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ public function testFindAlternativeExceptionMessageMultiple()
568568

569569
// Subnamespace + plural
570570
try {
571-
$a = $application->find('foo3:');
571+
$application->find('foo3:');
572572
$this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives');
573573
} catch (\Exception $e) {
574574
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e);

src/Symfony/Component/Console/Tests/Helper/ProgressIndicatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testCannotSetInvalidIndicatorCharacters()
104104
{
105105
$this->expectException('InvalidArgumentException');
106106
$this->expectExceptionMessage('Must have at least 2 indicator value characters.');
107-
$bar = new ProgressIndicator($this->getOutputStream(), null, 100, ['1']);
107+
new ProgressIndicator($this->getOutputStream(), null, 100, ['1']);
108108
}
109109

110110
public function testCannotStartAlreadyStartedIndicator()

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private function darwinRealpath($real)
482482
}
483483

484484
if (isset($dirFiles[$file])) {
485-
return $real .= $dirFiles[$file];
485+
return $real.$dirFiles[$file];
486486
}
487487

488488
$kFile = strtolower($file);
@@ -501,7 +501,7 @@ private function darwinRealpath($real)
501501
self::$darwinCache[$kDir][1] = $dirFiles;
502502
}
503503

504-
return $real .= $dirFiles[$kFile];
504+
return $real.$dirFiles[$kFile];
505505
}
506506

507507
/**

src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ function () {},
294294

295295
// assertEquals() does not like NAN values.
296296
$this->assertEquals($array[$i][0], 'float');
297-
$this->assertNan($array[$i++][1]);
297+
$this->assertNan($array[$i][1]);
298298
}
299299

300300
public function testRecursionInArguments()

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function dump(array $options = [])
256256
foreach ($ids as $id) {
257257
$c .= ' '.$this->doExport($id)." => true,\n";
258258
}
259-
$files['removed-ids.php'] = $c .= "];\n";
259+
$files['removed-ids.php'] = $c."];\n";
260260
}
261261

262262
foreach ($this->generateServiceFiles($services) as $file => $c) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ public function testProcess()
2424
{
2525
$container = new ContainerBuilder();
2626

27-
$a = $container
27+
$container
2828
->register('a')
2929
->addArgument($ref1 = new Reference('b'))
3030
;
3131

32-
$b = $container
32+
$container
3333
->register('b')
3434
->addMethodCall('setA', [$ref2 = new Reference('a')])
3535
;
3636

37-
$c = $container
37+
$container
3838
->register('c')
3939
->addArgument($ref3 = new Reference('a'))
4040
->addArgument($ref4 = new Reference('b'))
4141
;
4242

43-
$d = $container
43+
$container
4444
->register('d')
4545
->setProperty('foo', $ref5 = new Reference('b'))
4646
;
4747

48-
$e = $container
48+
$container
4949
->register('e')
5050
->setConfigurator([$ref6 = new Reference('b'), 'methodName'])
5151
;

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testProcessRemovesAndInlinesRecursively()
5050
->setPublic(true)
5151
;
5252

53-
$b = $container
53+
$container
5454< F5EA /code>
->register('b', '\stdClass')
5555
->addArgument(new Reference('c'))
5656
->setPublic(false)

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveChildDefinitionsPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public function testBindings()
363363
->setBindings(['a' => '1', 'b' => '2'])
364364
;
365365

366-
$child = $container->setDefinition('child', new ChildDefinition('parent'))
366+
$container->setDefinition('child', new ChildDefinition('parent'))
367367
->setBindings(['b' => 'B', 'c' => 'C'])
368368
;
369369

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveClassPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public function testAmbiguousChildDefinition()
8787
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
8888
$this->expectExceptionMessage('Service definition "App\Foo\Child" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.');
8989
$container = new ContainerBuilder();
90-
$parent = $container->register('App\Foo', null);
91-
$child = $container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));
90+
$container->register('App\Foo', null);
91+
$container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));
9292

9393
(new ResolveClassPass())->process($container);
9494
}

0 commit comments

Comments
 (0)
0