Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3449e6

Browse files
Merge branch '3.4'
* 3.4: bug #22814 [FrameworkBundle] FC with EventDispatcher 4.0 (xabbuh) [PhpUnitBridge] remove unused use statement do not used deprecated validator test case class do not mock a deprecated interface [DI] Added missing deprecation in changelog [Ldap] add a changelog file [Security][Serializer][DI] Add new arguments typehints in preparation for 4.0 [MonologBridge] Fix the Monlog ServerLogHandler from Hanging on Windows [DependencyInjection] Fix dumping of RewindableGenerator with empty IteratorArgument [DI][Serializer] Fix missing de(normalizer|coder) autoconfig Use 0.0.0.0 as the server log host default.
2 parents 339c653 + b6fced6 commit d3449e6

File tree

31 files changed

+103
-58
lines changed

31 files changed

+103
-58
lines changed

UPGRADE-3.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Security
303303
* The `RoleInterface` has been deprecated. Extend the `Symfony\Component\Security\Core\Role\Role`
304304
class in your custom role implementations instead.
305305

306-
* The `LogoutUrlGenerator::registerListener()` method will expect a 6th `$context = null` argument in 4.0.
306+
* The `LogoutUrlGenerator::registerListener()` method will expect a 6th `string $context = null` argument in 4.0.
307307
Define the argument when overriding this method.
308308

309309
* The `AccessDecisionManager::setVoters()` method has been deprecated. Pass

UPGRADE-4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ Security
426426
* The `RoleInterface` has been removed. Extend the `Symfony\Component\Security\Core\Role\Role`
427427
class instead.
428428

429-
* The `LogoutUrlGenerator::registerListener()` method expects a 6th `$context = null` argument.
429+
* The `LogoutUrlGenerator::registerListener()` method expects a 6th `string $context = null` argument.
430430

431431
* The `AccessDecisionManager::setVoters()` method has been removed. Pass the
432432
voters to the constructor instead.

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@
3131
use Symfony\Bridge\Doctrine\Tests\Fixtures\Type\StringWrapper;
3232
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
3333
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator;
34-
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
34+
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
3535
use Doctrine\ORM\Tools\SchemaTool;
3636

3737
/**
3838
* @author Bernhard Schussek <[email protected]>
39-
*
40-
* @todo use ConstraintValidatorTestCase when symfony/validator ~3.2 is required.
4139
*/
42-
class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
40+
class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
4341
{
4442
const EM_NAME = 'foo';
4543

src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public function handle(array $record)
5454

5555
$recordFormatted = $this->formatRecord($record);
5656

57-
if (!fwrite($this->socket, $recordFormatted)) {
58-
fclose($this->socket);
57+
if (-1 === stream_socket_sendto($this->socket, $recordFormatted)) {
58+
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
5959

6060
// Let's retry: the persistent connection might just be stale
6161
if ($this->socket = $this->createSocket()) {
62-
fwrite($this->socket, $recordFormatted);
62+
stream_socket_sendto($this->socket, $recordFormatted);
6363
}
6464
}
6565
} finally {

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use PHPUnit\Framework\TestCase;
1717
use PHPUnit\Framework\TestSuite;
1818
use PHPUnit\Util\Blacklist;
19-
use PHPUnit\Util\Test;
2019
use Symfony\Bridge\PhpUnit\ClockMock;
2120
use Symfony\Bridge\PhpUnit\DnsMock;
2221

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@
4949
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
5050
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
5151
use Symfony\Component\Serializer\Encoder\CsvEncoder;
52+
use Symfony\Component\Serializer\Encoder\DecoderInterface;
5253
use Symfony\Component\Serializer\Encoder\EncoderInterface;
5354
use Symfony\Component\Serializer\Encoder\YamlEncoder;
5455
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
5556
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
5657
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
58+
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
5759
use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
5860
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
5961
use Symfony\Component\Validator\ConstraintValidatorInterface;
@@ -285,8 +287,12 @@ public function load(array $configs, ContainerBuilder $container)
285287
->addTag('property_info.access_extractor');
286288
$container->registerForAutoconfiguration(EncoderInterface::class)
287289
->addTag('serializer.encoder');
290+
$container->registerForAutoconfiguration(DecoderInterface::class)
291+
->addTag('serializer.encoder');
288292
$container->registerForAutoconfiguration(NormalizerInterface::class)
289293
->addTag('serializer.normalizer');
294+
$container->registerForAutoconfiguration(DenormalizerInterface::class)
295+
->addTag('serializer.normalizer');
290296
$container->registerForAutoconfiguration(ConstraintValidatorInterface::class)
291297
->addTag('validator.constraint_validator');
292298
$container->registerForAutoconfiguration(ObjectInitializerInterface::class)

src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function configure()
4747
}
4848

4949
$this
50-
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0:9911')
50+
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0.0.0.0:9911')
5151
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)
5252
->addOption('date-format', null, InputOption::VALUE_REQUIRED, 'The date format', ConsoleFormatter::SIMPLE_DATE)
5353
->addOption('filter', null, InputOption::VALUE_REQUIRED, 'An expression to filter log. Example: "level > 200 or channel in [\'app\', \'doctrine\']"')

src/Symfony/Component/DependencyInjection/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ CHANGELOG
3737
* deprecated the ability to set or unset a private service with the `Container::set()` method
3838
* deprecated the ability to check for the existence of a private service with the `Container::has()` method
3939
* deprecated the ability to request a private service with the `Container::get()` method
40+
* deprecated support for generating a dumped `Container` without populating the method map
4041

4142
3.0.0
4243
-----

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public function getLoggingFormatter()
7777
* @param string $type The type of the pass
7878
* @param int $priority Used to sort the passes
7979
*/
80-
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
80+
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
8181
{
8282
if (func_num_args() >= 3) {
8383
$priority = func_get_arg(2);
8484
} else {
8585
if (__CLASS__ !== get_class($this)) {
8686
$r = new \ReflectionMethod($this, __FUNCTION__);
8787
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
88-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
88+
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
8989
}
9090
}
9191

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ public function getPasses()
108108
*
109109
* @throws InvalidArgumentException when a pass type doesn't exist
110110
*/
111-
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
111+
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
112112
{
113113
if (func_num_args() >= 3) {
114114
$priority = func_get_arg(2);
115115
} else {
116116
if (__CLASS__ !== get_class($this)) {
117117
$r = new \ReflectionMethod($this, __FUNCTION__);
118118
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
119-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
119+
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
120120
}
121121
}
122122

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ public function clear()
8686
* @param string $reference
8787
* @param bool $lazy
8888
*/
89-
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, $lazy = false*/)
89+
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false*/)
9090
{
9191
if (func_num_args() >= 6) {
9292
$lazy = func_get_arg(5);
9393
} else {
9494
if (__CLASS__ !== get_class($this)) {
9595
$r = new \ReflectionMethod($this, __FUNCTION__);
9696
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
97-
@trigger_error(sprintf('Method %s() will have a 6th `$lazy = false` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
97+
@trigger_error(sprintf('Method %s() will have a 6th `bool $lazy = false` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
9898
}
9999
}
100100
$lazy = false;

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ public function loadFromExtension($extension, array $values = array())
448448
*
449449
* @return $this
450450
*/
451-
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
451+
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
452452
{
453453
if (func_num_args() >= 3) {
454454
$priority = func_get_arg(2);
455455
} else {
456456
if (__CLASS__ !== get_class($this)) {
457457
$r = new \ReflectionMethod($this, __FUNCTION__);
458458
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
459-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
459+
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
460460
}
461461
}
462462

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,24 +1429,29 @@ private function dumpValue($value, $interpolate = true)
14291429
}
14301430

14311431
if ($value instanceof IteratorArgument) {
1432-
$countCode = array();
1433-
$countCode[] = 'function () {';
14341432
$operands = array(0);
1435-
14361433
$code = array();
14371434
$code[] = 'new RewindableGenerator(function () {';
1438-
foreach ($value->getValues() as $k => $v) {
1439-
($c = $this->getServiceConditionals($v)) ? $operands[] = "(int) ($c)" : ++$operands[0];
1440-
$v = $this->wrapServiceConditionals($v, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)));
1441-
foreach (explode("\n", $v) as $v) {
1442-
if ($v) {
1443-
$code[] = ' '.$v;
1435+
1436+
if (!$values = $value->getValues()) {
1437+
$code[] = ' return new \EmptyIterator();';
1438+
} else {
1439+
$countCode = array();
1440+
$countCode[] = 'function () {';
1441+
1442+
foreach ($values as $k => $v) {
1443+
($c = $this->getServiceConditionals($v)) ? $operands[] = "(int) ($c)" : ++$operands[0];
1444+
$v = $this->wrapServiceConditionals($v, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)));
1445+
foreach (explode("\n", $v) as $v) {
1446+
if ($v) {
1447+
$code[] = ' '.$v;
1448+
}
14441449
}
14451450
}
1446-
}
14471451

1448-
$countCode[] = sprintf(' return %s;', implode(' + ', $operands));
1449-
$countCode[] = ' }';
1452+
$countCode[] = sprintf(' return %s;', implode(' + ', $operands));
1453+
$countCode[] = ' }';
1454+
}
14501455

14511456
$code[] = sprintf(' }, %s)', count($operands) > 1 ? implode("\n", $countCode) : $operands[0]);
14521457

src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,17 @@ public function testCreateServiceWithIteratorArgument()
449449
$builder->register('bar', 'stdClass');
450450
$builder
451451
->register('lazy_context', 'LazyContext')
452-
->setArguments(array(new IteratorArgument(array('k1' => new Reference('bar'), new Reference('invalid', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))))
452+
->setArguments(array(
453+
new IteratorArgument(array('k1' => new Reference('bar'), new Reference('invalid', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))),
454+
new IteratorArgument(array()),
455+
))
453456
;
454457

455458
$lazyContext = $builder->get('lazy_context');
456459
$this->assertInstanceOf(RewindableGenerator::class, $lazyContext->lazyValues);
460+
$this->assertInstanceOf(RewindableGenerator::class, $lazyContext->lazyEmptyValues);
457461
$this->assertCount(1, $lazyContext->lazyValues);
462+
$this->assertCount(0, $lazyContext->lazyEmptyValues);
458463

459464
$i = 0;
460465
foreach ($lazyContext->lazyValues as $k => $v) {
@@ -465,6 +470,13 @@ public function testCreateServiceWithIteratorArgument()
465470

466471
// The second argument should have been ignored.
467472
$this->assertEquals(1, $i);
473+
474+
$i = 0;
475+
foreach ($lazyContext->lazyEmptyValues as $k => $v) {
476+
++$i;
477+
}
478+
479+
$this->assertEquals(0, $i);
468480
}
469481

470482
/**

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ public function testLazyArgumentProvideGenerator()
436436
$container->register('lazy_referenced', 'stdClass');
437437
$container
438438
->register('lazy_context', 'LazyContext')
439-
->setArguments(array(new IteratorArgument(array('k1' => new Reference('lazy_referenced'), 'k2' => new Reference('service_container')))))
439+
->setArguments(array(
440+
new IteratorArgument(array('k1' => new Reference('lazy_referenced'), 'k2' => new Reference('service_container'))),
441+
new IteratorArgument(array()),
442+
))
440443
;
441444
$container->compile();
442445

@@ -447,6 +450,9 @@ public function testLazyArgumentProvideGenerator()
447450
$lazyContext = $container->get('lazy_context');
448451

449452
$this->assertInstanceOf(RewindableGenerator::class, $lazyContext->lazyValues);
453+
$this->assertInstanceOf(RewindableGenerator::class, $lazyContext->lazyEmptyValues);
454+
$this->assertCount(2, $lazyContext->lazyValues);
455+
$this->assertCount(0, $lazyContext->lazyEmptyValues);
450456

451457
$i = -1;
452458
foreach ($lazyContext->lazyValues as $k => $v) {
@@ -461,6 +467,8 @@ public function testLazyArgumentProvideGenerator()
461467
break;
462468
}
463469
}
470+
471+
$this->assertEmpty(iterator_to_array($lazyContext->lazyEmptyValues));
464472
}
465473

466474
public function testClosureProxy()

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134
;
135135
$container
136136
->register('lazy_context', 'LazyContext')
137-
->setArguments(array(new IteratorArgument(array('k1' => new Reference('foo.baz'), 'k2' => new Reference('service_container')))))
137+
->setArguments(array(new IteratorArgument(array('k1' => new Reference('foo.baz'), 'k2' => new Reference('service_container'))), new IteratorArgument(array())))
138138
;
139139
$container
140140
->register('lazy_context_ignore_invalid_ref', 'LazyContext')
141-
->setArguments(array(new IteratorArgument(array(new Reference('foo.baz'), new Reference('invalid', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))))
141+
->setArguments(array(new IteratorArgument(array(new Reference('foo.baz'), new Reference('invalid', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))), new IteratorArgument(array())))
142142
;
143143
$container
144144
->register('closure_proxy', 'BarClass')

src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ public function getProxyCode(Definition $definition)
102102
class LazyContext
103103
{
104104
public $lazyValues;
105+
public $lazyEmptyValues;
105106

106-
public function __construct($lazyValues)
107+
public function __construct($lazyValues, $lazyEmptyValues)
107108
{
108109
$this->lazyValues = $lazyValues;
110+
$this->lazyEmptyValues = $lazyEmptyValues;
109111
}
110112
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ protected function getLazyContextService()
323323
return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
324324
yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
325325
yield 'k2' => $this;
326-
}, 2));
326+
}, 2), new RewindableGenerator(function () {
327+
return new \EmptyIterator();
328+
}, 0));
327329
}
328330

329331
/**
@@ -343,7 +345,9 @@ protected function getLazyContextIgnoreInvalidRefService()
343345
}
344346
}, function () {
345347
return 1 + (int) ($this->has('invalid'));
346-
}));
348+
}), new RewindableGenerator(function () {
349+
return new \EmptyIterator();
350+
}, 0));
347351
}
348352

349353
/**

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ protected function getLazyContextService()
326326
return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
327327
yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
328328
yield 'k2' => $this;
329-
}, 2));
329+
}, 2), new RewindableGenerator(function () {
330+
return new \EmptyIterator();
331+
}, 0));
330332
}
331333

332334
/**
@@ -341,7 +343,9 @@ protected function getLazyContextIgnoreInvalidRefService()
341343
{
342344
return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
343345
yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
344-
}, 1));
346+
}, 1), new RewindableGenerator(function () {
347+
return new \EmptyIterator();
348+
}, 0));
345349
}
346350

347351
/**

src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@
121121
<argument key="k1" type="service" id="foo.baz"/>
122122
<argument key="k2" type="service" id="service_container"/>
123123
</argument>
124+
<argument type="iterator"/>
124125
</service>
125126
<service id="lazy_context_ignore_invalid_ref" class="LazyContext">
126127
<argument type="iterator">
127128
<argument type="service" id="foo.baz"/>
128129
<argument type="service" id="invalid" on-invalid="ignore"/>
129130
</argument>
131+
<argument type="iterator"/>
130132
</service>
131133
<service id="closure_proxy" class="BarClass">
132134
<argument type="closure-proxy" id="closure_proxy" method="getBaz"/>

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ services:
112112
factory: ['@factory_simple', getInstance]
113113
lazy_context:
114114
class: LazyContext
115-
arguments: [!iterator {'k1': '@foo.baz', 'k2': '@service_container'}]
115+
arguments: [!iterator {'k1': '@foo.baz', 'k2': '@service_container'}, !iterator []]
116116
lazy_context_ignore_invalid_ref:
117117
class: LazyContext
118-
arguments: [!iterator ['@foo.baz', '@?invalid']]
118+
arguments: [!iterator ['@foo.baz', '@?invalid'], !iterator []]
119119
closure_proxy:
120120
class: BarClass
121121
arguments: [!closure_proxy ['@closure_proxy', getBaz]]

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function testParsesIteratorArgument()
273273

274274
$lazyDefinition = $container->getDefinition('lazy_context');
275275

276-
$this->assertEquals(array(new IteratorArgument(array('k1' => new Reference('foo.baz'), 'k2' => new Reference('service_container')))), $lazyDefinition->getArguments(), '->load() parses lazy arguments');
276+
$this->assertEquals(array(new IteratorArgument(array('k1' => new Reference('foo.baz'), 'k2' => new Reference('service_container'))), new IteratorArgument(array())), $lazyDefinition->getArguments(), '->load() parses lazy arguments');
277277
}
278278

279279
public function testParsesTags()
@@ -659,7 +659,6 @@ public function testDefaults()
659659

660660
$this->assertFalse($container->getDefinition('no_defaults')->isAutowired());
661661

662-
663662
$this->assertTrue($container->getDefinition('child_def')->isPublic());
664663
$this->assertSame(array('foo' => array(array())), $container->getDefinition('child_def')->getTags());
665664
$this->assertFalse($container->getDefinition('child_def')->isAutowired());

0 commit comments

Comments
 (0)