diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/symfony/service-contracts/Attribute | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/symfony/service-contracts/Attribute')
| -rw-r--r-- | vendor/symfony/service-contracts/Attribute/Required.php | 25 | ||||
| -rw-r--r-- | vendor/symfony/service-contracts/Attribute/SubscribedService.php | 47 |
2 files changed, 72 insertions, 0 deletions
diff --git a/vendor/symfony/service-contracts/Attribute/Required.php b/vendor/symfony/service-contracts/Attribute/Required.php new file mode 100644 index 0000000..9df8511 --- /dev/null +++ b/vendor/symfony/service-contracts/Attribute/Required.php | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | /* | ||
| 4 | * This file is part of the Symfony package. | ||
| 5 | * | ||
| 6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
| 7 | * | ||
| 8 | * For the full copyright and license information, please view the LICENSE | ||
| 9 | * file that was distributed with this source code. | ||
| 10 | */ | ||
| 11 | |||
| 12 | namespace Symfony\Contracts\Service\Attribute; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * A required dependency. | ||
| 16 | * | ||
| 17 | * This attribute indicates that a property holds a required dependency. The annotated property or method should be | ||
| 18 | * considered during the instantiation process of the containing class. | ||
| 19 | * | ||
| 20 | * @author Alexander M. Turek <me@derrabus.de> | ||
| 21 | */ | ||
| 22 | #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] | ||
| 23 | final class Required | ||
| 24 | { | ||
| 25 | } | ||
diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php new file mode 100644 index 0000000..f850b84 --- /dev/null +++ b/vendor/symfony/service-contracts/Attribute/SubscribedService.php | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | /* | ||
| 4 | * This file is part of the Symfony package. | ||
| 5 | * | ||
| 6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
| 7 | * | ||
| 8 | * For the full copyright and license information, please view the LICENSE | ||
| 9 | * file that was distributed with this source code. | ||
| 10 | */ | ||
| 11 | |||
| 12 | namespace Symfony\Contracts\Service\Attribute; | ||
| 13 | |||
| 14 | use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait; | ||
| 15 | use Symfony\Contracts\Service\ServiceSubscriberInterface; | ||
| 16 | |||
| 17 | /** | ||
| 18 | * For use as the return value for {@see ServiceSubscriberInterface}. | ||
| 19 | * | ||
| 20 | * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) | ||
| 21 | * | ||
| 22 | * Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type | ||
| 23 | * as a subscribed service. | ||
| 24 | * | ||
| 25 | * @author Kevin Bond <kevinbond@gmail.com> | ||
| 26 | */ | ||
| 27 | #[\Attribute(\Attribute::TARGET_METHOD)] | ||
| 28 | final class SubscribedService | ||
| 29 | { | ||
| 30 | /** @var object[] */ | ||
| 31 | public array $attributes; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * @param string|null $key The key to use for the service | ||
| 35 | * @param class-string|null $type The service class | ||
| 36 | * @param bool $nullable Whether the service is optional | ||
| 37 | * @param object|object[] $attributes One or more dependency injection attributes to use | ||
| 38 | */ | ||
| 39 | public function __construct( | ||
| 40 | public ?string $key = null, | ||
| 41 | public ?string $type = null, | ||
| 42 | public bool $nullable = false, | ||
| 43 | array|object $attributes = [], | ||
| 44 | ) { | ||
| 45 | $this->attributes = \is_array($attributes) ? $attributes : [$attributes]; | ||
| 46 | } | ||
| 47 | } | ||
