
| Current Path : /var/www/html/vendor/drush/drush/src/Command/ |
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/drush/drush/src/Command/DrushCommandInfoAlterer.php |
<?php
namespace Drush\Command;
use Consolidation\AnnotatedCommand\CommandInfoAltererInterface;
use Consolidation\AnnotatedCommand\Parser\CommandInfo;
class DrushCommandInfoAlterer implements CommandInfoAltererInterface
{
public function alterCommandInfo(CommandInfo $commandInfo, $commandFileInstance): void
{
// If a command has a @filter-default-field annotation, that
// implies that it also has an implicit @filter-output annotation.
if ($commandInfo->hasAnnotation('filter-default-field') && !$commandInfo->hasAnnotation('filter-output')) {
$commandInfo->addAnnotation('filter-output', true);
}
// Automatically add the help topic for output formatters to
// any command that has any annotations related to output filters
if ($commandInfo->hasAnnotation('filter-output') || $commandInfo->hasAnnotation('field-labels')) {
if ($commandInfo->hasAnnotation('topics')) {
// Topic value may have multiple values separated by a comma.
$values = $commandInfo->getAnnotationList('topics');
$commandInfo->removeAnnotation('topics');
$commandInfo->addAnnotation('topics', $values);
}
$commandInfo->addAnnotation('topics', 'docs:output-formats-filters');
}
}
}