[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/symfony/console/Attribute/ -> AsCommand.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <[email protected]>
   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      public function __construct(
  21          public string $name,
  22          public ?string $description = null,
  23          array $aliases = [],
  24          bool $hidden = false,
  25      ) {
  26          if (!$hidden && !$aliases) {
  27              return;
  28          }
  29  
  30          $name = explode('|', $name);
  31          $name = array_merge($name, $aliases);
  32  
  33          if ($hidden && '' !== $name[0]) {
  34              array_unshift($name, '');
  35          }
  36  
  37          $this->name = implode('|', $name);
  38      }
  39  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer