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

Returns the string representation of the given error. For example when given an
E_WARNING, the method returns "E_WARNING".

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::toString(E_WARNING);
// Outputs: "E_WARNING"

echo Errors::toString("E_CORE_ERROR");
// Outputs: "E_CORE_ERROR"
```

@param  int|string $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 a string