Skip to content

Commit d32bbd6

Browse files
Use CPP where possible
1 parent 8b53213 commit d32bbd6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Tests/Compiler/RegisterServiceSubscribersPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public static function getSubscribedServices(): array
452452
'autowired' => new ServiceClosureArgument(new TypedReference('service.id', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'autowired', [new Autowire(service: 'service.id')])),
453453
'autowired.nullable' => new ServiceClosureArgument(new TypedReference('service.id', 'stdClass', ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'autowired.nullable', [new Autowire(service: 'service.id')])),
454454
'autowired.parameter' => new ServiceClosureArgument('foobar'),
455-
'autowire.decorated' => new ServiceClosureArgument(new Reference('.service_locator.PIYLhDv.inner', ContainerInterface::NULL_ON_INVALID_REFERENCE)),
455+
'autowire.decorated' => new ServiceClosureArgument(new Reference('.service_locator.oNVewcO.inner', ContainerInterface::NULL_ON_INVALID_REFERENCE)),
456456
'target' => new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'target', [new Target('someTarget')])),
457457
];
458458
$this->assertEquals($expected, $container->getDefinition((string) $locator->getFactory()[0])->getArgument(0));

TypedReference.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
class TypedReference extends Reference
2020
{
21-
private string $type;
2221
private ?string $name;
2322

2423
/**
@@ -30,14 +29,13 @@ class TypedReference extends Reference
3029
*/
3130
public function __construct(
3231
string $id,
33-
string $type,
32+
private string $type,
3433
int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
3534
?string $name = null,
3635
private array $attributes = [],
3736
) {
3837
$this->name = $type === $id ? $name : null;
3938
parent::__construct($id, $invalidBehavior);
40-
$this->type = $type;
4139
}
4240

4341
public function getType(): string

0 commit comments

Comments
 (0)