Skip to content

Commit 7c600b5

Browse files
committed
[DependencyInjection] Rename #[InnerService] to #[Decorated]
1 parent 84d35a2 commit 7c600b5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Symfony/Component/DependencyInjection/Attribute/InnerService.php renamed to src/Symfony/Component/DependencyInjection/Attribute/Decorated.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Attribute;
1313

1414
#[\Attribute(\Attribute::TARGET_PARAMETER)]
15-
class InnerService
15+
class Decorated
1616
{
1717
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
1616
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
1717
use Symfony\Component\DependencyInjection\Attribute\Autowire;
18-
use Symfony\Component\DependencyInjection\Attribute\InnerService;
18+
use Symfony\Component\DependencyInjection\Attribute\Decorated;
1919
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
2020
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
2121
use Symfony\Component\DependencyInjection\Attribute\Target;
@@ -273,7 +273,7 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
273273
break;
274274
}
275275

276-
if (InnerService::class === $attribute->getName()) {
276+
if (Decorated::class === $attribute->getName()) {
277277
$arguments[$index] = new Reference($this->currentId.'.inner', ContainerInterface::NULL_ON_INVALID_REFERENCE);
278278

279279
break;

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
66
use Symfony\Component\DependencyInjection\Attribute\Autowire;
7-
use Symfony\Component\DependencyInjection\Attribute\InnerService;
7+
use Symfony\Component\DependencyInjection\Attribute\Decorated;
88
use Symfony\Component\DependencyInjection\ContainerInterface;
99
use Symfony\Contracts\Service\Attribute\Required;
1010

@@ -65,23 +65,23 @@ class AsDecoratorFoo implements AsDecoratorInterface
6565
#[AsDecorator(decorates: AsDecoratorFoo::class, priority: 10)]
6666
class AsDecoratorBar10 implements AsDecoratorInterface
6767
{
68-
public function __construct(string $arg1, #[InnerService] AsDecoratorInterface $inner)
68+
public function __construct(string $arg1, #[Decorated] AsDecoratorInterface $inner)
6969
{
7070
}
7171
}
7272

7373
#[AsDecorator(decorates: AsDecoratorFoo::class, priority: 20)]
7474
class AsDecoratorBar20 implements AsDecoratorInterface
7575
{
76-
public function __construct(string $arg1, #[InnerService] AsDecoratorInterface $inner)
76+
public function __construct(string $arg1, #[Decorated] AsDecoratorInterface $inner)
7777
{
7878
}
7979
}
8080

8181
#[AsDecorator(decorates: \NonExistent::class, onInvalid: ContainerInterface::NULL_ON_INVALID_REFERENCE)]
8282
class AsDecoratorBaz implements AsDecoratorInterface
8383
{
84-
public function __construct(#[InnerService] AsDecoratorInterface $inner = null)
84+
public function __construct(#[Decorated] AsDecoratorInterface $inner = null)
8585
{
8686
}
8787
}

0 commit comments

Comments
 (0)