CoreFiles by mySites.guru
AsCommand.php39 lines, 861 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
7f2e1592ba6ad10eaabb6d3f7066df3a
sha1
4b62ed2311d58a400a4ec9dfdfbc8444dca29c37
sha256
738d4be88712392baba266c040cc3cc94540b1e7919414c7a44f06f2a1f60738
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Attribute;

/**
 * Service tag to autoconfigure commands.
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
class AsCommand
{
    public function __construct(
        public string $name,
        public ?string $description = null,
        array $aliases = [],
        bool $hidden = false,
    ) {
        if (!$hidden && !$aliases) {
            return;
        }

        $name = explode('|', $name);
        $name = array_merge($name, $aliases);

        if ($hidden && '' !== $name[0]) {
            array_unshift($name, '');
        }

        $this->name = implode('|', $name);
    }
}

The same content is in 228 releases, Joomla 4.0.0-rc6 to 6.0.0-alpha3. See them all, or every version of this file.