8000 bug #24365 [DependencyInjection] fix tests (xabbuh) · symfony/symfony@73ef4a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73ef4a9

Browse files
committed
bug #24365 [DependencyInjection] fix tests (xabbuh)
This PR was merged into the 4.0-dev branch. Discussion ---------- [DependencyInjection] fix tests | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | adapt tests from #22200 | License | MIT | Doc PR | Commits ------- 08deb37 [DependencyInjection] fix tests
2 parents 3fde0f0 + 08deb37 commit 73ef4a9

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
274274
// Returns the public 'tagged_iterator' shared service.
275275

276276
return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
277-
yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(__DIR__.'/getFooService.php')) && false ?: '_'};
278-
yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
277+
yield 0 => ($this->services['foo'] ?? $this->load(__DIR__.'/getFooService.php'));
278+
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
279279
}, 2));
280280

281281
[Container%s/getTaggedIteratorFooService.php] => <?php
@@ -285,7 +285,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
285285
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
286286
// Returns the private 'tagged_iterator_foo' shared service.
287287

288-
return $this->services['tagged_iterator_foo'] = new \Bar();
288+
return $this->privates['tagged_iterator_foo'] = new \Bar();
289289

290290
[Container%s/Container.php] => <?php
291291

@@ -348,7 +348,6 @@ class Container%s extends Container
348348
'new_factory_service' => __DIR__.'/getNewFactoryServiceService.php',
349349
'service_from_static_method' => __DIR__.'/getServiceFromStaticMethodService.php',
350350
'tagged_iterator' => __DIR__.'/getTaggedIteratorService.php',
351-
'tagged_iterator_foo' => __DIR__.'/getTaggedIteratorFooService.php',
352351
);
353352
$this->aliases = array(
354353
'alias_for_alias' => 'foo',

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function __construct()
5353
'new_factory_service' => 'getNewFactoryServiceService',
5454
'service_from_static_method' => 'getServiceFromStaticMethodService',
5555
'tagged_iterator' => 'getTaggedIteratorService',
56-
'tagged_iterator_foo' => 'getTaggedIteratorFooService',
5756
);
5857
$this->aliases = array(
5958
'alias_for_alias' => 'foo',
@@ -382,8 +381,8 @@ protected function getServiceFromStaticMethodService()
382381
protected function getTaggedIteratorService()
383382
{
384383
return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
385-
yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'};
386-
yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
384+
yield 0 => ($this->services['foo'] ?? $this->getFooService());
385+
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
387386
}, 2));
388387
}
389388

@@ -401,16 +400,6 @@ protected function getFactorySimpleService()
401400
return $this->privates['factory_simple'] = new \SimpleFactoryClass('foo');
402401
}
403402

404-
/**
405-
* Gets the private 'tagged_iterator_foo' shared service.
406-
*
407-
* @return \Bar
408-
*/
409-
protected function getTaggedIteratorFooService()
410-
{
411-
return $this->services['tagged_iterator_foo'] = new \Bar();
412-
}
413-
414403
/**
415404
* {@inheritdoc}
416405
*/

0 commit comments

Comments
 (0)
0