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/console/Attribute/AsCommand.php | |
| 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/console/Attribute/AsCommand.php')
| -rw-r--r-- | vendor/symfony/console/Attribute/AsCommand.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/symfony/console/Attribute/AsCommand.php b/vendor/symfony/console/Attribute/AsCommand.php new file mode 100644 index 0000000..6066d7c --- /dev/null +++ b/vendor/symfony/console/Attribute/AsCommand.php | |||
| @@ -0,0 +1,45 @@ | |||
| 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\Component\Console\Attribute; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * Service tag to autoconfigure commands. | ||
| 16 | */ | ||
| 17 | #[\Attribute(\Attribute::TARGET_CLASS)] | ||
| 18 | class AsCommand | ||
| 19 | { | ||
| 20 | /** | ||
| 21 | * @param string $name The name of the command, used when calling it (i.e. "cache:clear") | ||
| 22 | * @param string|null $description The description of the command, displayed with the help page | ||
| 23 | * @param string[] $aliases The list of aliases of the command. The command will be executed when using one of them (i.e. "cache:clean") | ||
| 24 | * @param bool $hidden If true, the command won't be shown when listing all the available commands, but it can still be run as any other command | ||
| 25 | */ | ||
| 26 | public function __construct( | ||
| 27 | public string $name, | ||
| 28 | public ?string $description = null, | ||
| 29 | array $aliases = [], | ||
| 30 | bool $hidden = false, | ||
| 31 | ) { | ||
| 32 | if (!$hidden && !$aliases) { | ||
| 33 | return; | ||
| 34 | } | ||
| 35 | |||
| 36 | $name = explode('|', $name); | ||
| 37 | $name = array_merge($name, $aliases); | ||
| 38 | |||
| 39 | if ($hidden && '' !== $name[0]) { | ||
| 40 | array_unshift($name, ''); | ||
| 41 | } | ||
| 42 | |||
| 43 | $this->name = implode('|', $name); | ||
| 44 | } | ||
| 45 | } | ||
