Closed
Description
Description
Scenario: you have a concrete class that implements an interface. Currently, you need to add an alias in your services configuration,
The idea is to avoid it with a new php8 attribute, that can be applied to the class.
Example
<?php
namespace Foo;
use Symfony\Component\DependencyInjection\Attribute\Alias;
#[Alias]
final class MyClass implements \Bar\MyInterface
{
// ...
}
the following then can be avoided:
services:
Bar\MyInterface: '@Foo\MyClass'