CoreFiles by mySites.guru
ThrowableUtils.php35 lines, 730 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
e64ebda5c9f436b8b586657b5d42d279
sha1
8e6bbf136b710170a5d907503eabc3950d69d957
sha256
f8f60cd36c112c931cb4d55ea18a95917b24b1bba0a0d94ec960e5194ca854c2
<?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\ErrorHandler;

/**
 * @internal
 */
class ThrowableUtils
{
    public static function getSeverity(\Throwable $throwable): int
    {
        if ($throwable instanceof \ErrorException) {
            return $throwable->getSeverity();
        }

        if ($throwable instanceof \ParseError) {
            return \E_PARSE;
        }

        if ($throwable instanceof \TypeError) {
            return \E_RECOVERABLE_ERROR;
        }

        return \E_ERROR;
    }
}

The same content is in 7 releases, Joomla 4.0.0-beta6 to 4.0.0-rc5. See them all, or every version of this file.