CoreFiles by mySites.guru
SignalMap.php36 lines, 906 bytes, from Joomla_5.2.0-Stable-Full_Package.zip
Raw History Compare with 5.1.4
md5
8b3856a4adafc308dd0a3c9009b96274
sha1
1c040c2b4b929a6b98fca54d08138a6679a36705
sha256
e97a24663257f28959d357c0d868cd00233f17733bda39ba91791a63ac777380
<?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\SignalRegistry;

/**
 * @author GrĂ©goire Pineau <[email protected]>
 */
class SignalMap
{
    private static array $map;

    public static function getSignalName(int $signal): ?string
    {
        if (!\extension_loaded('pcntl')) {
            return null;
        }

        if (!isset(self::$map)) {
            $r = new \ReflectionExtension('pcntl');
            $c = $r->getConstants();
            $map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_'), \ARRAY_FILTER_USE_KEY);
            self::$map = array_flip($map);
        }

        return self::$map[$signal] ?? null;
    }
}

The same content is in 60 releases, Joomla 5.1.0-beta1 to 6.0.0-alpha3. See them all, or every version of this file.