22 lines
428 B
PHP
22 lines
428 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\KupShopBundle\Attribute;
|
|
|
|
/**
|
|
* Overrides existing DI service by current class and excludes current class from DI to avoid duplicate services.
|
|
*/
|
|
#[\Attribute(\Attribute::TARGET_CLASS)]
|
|
class OverrideService
|
|
{
|
|
public function __construct(private readonly string $service)
|
|
{
|
|
}
|
|
|
|
public function getService(): string
|
|
{
|
|
return $this->service;
|
|
}
|
|
}
|