
| Current Path : /var/www/html/sirius-pallets/vendor/drush/drush/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/sirius-pallets/vendor/drush/drush/src/Attributes/Bootstrap.php |
<?php
declare(strict_types=1);
namespace Drush\Attributes;
use Attribute;
use Consolidation\AnnotatedCommand\Parser\CommandInfo;
use Drush\Boot\DrupalBootLevels;
use JetBrains\PhpStorm\ExpectedValues;
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)]
class Bootstrap
{
/**
* @param $level
* The level to bootstrap to.
* @package $extra
* A maximum level when used with MAX.
*/
public function __construct(
#[ExpectedValues(valuesFromClass: DrupalBootLevels::class)] public int $level,
public ?int $max_level = null,
) {
}
public static function handle(\ReflectionAttribute $attribute, CommandInfo $commandInfo)
{
$instance = $attribute->newInstance();
$commandInfo->addAnnotation('bootstrap', $instance->level . ( isset($instance->max_level) ? " $instance->max_level" : ''));
}
}