CoreFiles by mySites.guru
ThrowableUtils.php35 lines, 727 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
7baa7ea222760bf0b95dabaa33d4be6a
sha1
a1f8351f27716ea05aab454ee23841c6a331729d
sha256
f7f6b4d7cc5af867cf35ee20f619b5f047b3fcafa089129e5c23fe4f8b50696a
<?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 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.