prolab-api/vendor/symfony/service-contracts/Attribute/SubscribedService.php

34 lines
800 B
PHP
Raw Normal View History

2025-09-24 06:24:52 +00: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;
2025-10-03 11:00:05 +00:00
use Symfony\Contracts\Service\ServiceSubscriberTrait;
2025-09-24 06:24:52 +00:00
/**
2025-10-03 11:00:05 +00:00
* Use with {@see ServiceSubscriberTrait} to mark a method's return type
2025-09-24 06:24:52 +00:00
* as a subscribed service.
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_METHOD)]
final class SubscribedService
{
/**
2025-10-03 11:00:05 +00:00
* @param string|null $key The key to use for the service
* If null, use "ClassName::methodName"
2025-09-24 06:24:52 +00:00
*/
public function __construct(
2025-10-03 11:00:05 +00:00
public ?string $key = null
2025-09-24 06:24:52 +00:00
) {
}
}