
| Current Path : /var/www/html/vendor/consolidation/annotated-command/src/Attributes/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/vendor/consolidation/annotated-command/src/Attributes/Usage.php |
<?php
namespace Consolidation\AnnotatedCommand\Attributes;
use Attribute;
use Consolidation\AnnotatedCommand\Parser\CommandInfo;
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Usage
{
/**
* @param $name
* The example command.
* @param $description
* A one line description.
*/
public function __construct(
public string $name,
public ?string $description = null
) {
}
public static function handle(\ReflectionAttribute $attribute, CommandInfo $commandInfo)
{
$args = $attribute->getArguments();
$commandInfo->setExampleUsage($args['name'], @$args['description']);
}
}