34 lines
800 B
PHP
Raw Permalink Normal View History

2024-05-31 09:27:37 +08:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Contracts\Service\Attribute;
2024-06-22 18:21:05 +08:00
use Symfony\Contracts\Service\ServiceSubscriberTrait;
2024-05-31 09:27:37 +08:00
/**
2024-06-22 18:21:05 +08:00
* Use with {@see ServiceSubscriberTrait} to mark a method's return type
2024-05-31 09:27:37 +08:00
* as a subscribed service.
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_METHOD)]
final class SubscribedService
{
/**
2024-06-22 18:21:05 +08:00
* @param string|null $key The key to use for the service
* If null, use "ClassName::methodName"
2024-05-31 09:27:37 +08:00
*/
public function __construct(
2024-06-22 18:21:05 +08:00
public ?string $key = null
2024-05-31 09:27:37 +08:00
) {
}
}