src/Headzoo/Core/Errors.php
public static function toInteger($error)
    {
        if (is_string($error) && isset(self::$errors[$error])) {
            $error = self::$errors[$error];
        }
        if (!is_int($error) || !in_array($error, self::$errors)) {
            self::toss(
                "InvalidArgument",
                "The value {0} is not a valid E_ERROR constant value.",
                $error
            );
        }
        
        return $error;
    }
public static function toInteger($error)
    {
        if (is_string($error) && isset(self::$errors[$error])) {
            $error = self::$errors[$error];
        }
        if (!is_int($error) || !in_array($error, self::$errors)) {
            self::toss(
                "InvalidArgument",
                "The value {0} is not a valid E_ERROR constant value.",
                $error
            );
        }
        
        return $error;
    }
public static function toInteger ( $ error ) { if ( is_string ( $ error ) && isset ( self :: $ errors [ $ error ] ) ) { $ error = self :: $ errors [ $ error ] ; } if ( ! is_int ( $ error ) || ! in_array ( $ error , self :: $ errors ) ) { self :: toss ( "InvalidArgument" , "The value {0} is not a valid E_ERROR constant value." , $ error ) ; } return $ error ; }
Returns the value of the error as an integer

The value of $error may be either one of the E_ERROR constants, or a string naming one
of the constants. The integer value of the constant is returned, or an exception is
thrown when $error is not valid.

The $error argument may be either an integer (one of the E_ERROR values) or a string
with the name of an E_ERROR constant.

Examples:
```php
echo Errors::toInteger("E_STRICT");
// Outputs: 2048

echo Errors::toInteger(E_WARNING);
// Outputs: 2
```

@param  string|int $error The error to convert
@throws Exceptions\InvalidArgumentException When $error is not a valid E_ERROR constant

@return int
Returns the value of the error as an integer