src/Headzoo/Core/Errors.php
public static function toUser(&$error)
    {
        $error_int = self::toInteger($error);
        switch($error_int) {
            case E_ERROR:
                $error = E_USER_ERROR;
                break;
            case E_WARNING:
                $error = E_USER_WARNING;
                break;
            case E_NOTICE:
                $error = E_USER_NOTICE;
                break;
            case E_DEPRECATED:
                $error = E_USER_DEPRECATED;
                break;
        }
        
        return self::isTrueUser($error);
    }
public static function toUser(&$error)
    {
        $error_int = self::toInteger($error);
        switch($error_int) {
            case E_ERROR:
                $error = E_USER_ERROR;
                break;
            case E_WARNING:
                $error = E_USER_WARNING;
                break;
            case E_NOTICE:
                $error = E_USER_NOTICE;
                break;
            case E_DEPRECATED:
                $error = E_USER_DEPRECATED;
                break;
        }
        
        return self::isTrueUser($error);
    }
public static function toUser ( & $ error ) { $ error_int = self :: toInteger ( $ error ) ; switch ( $ error_int ) { case E_ERROR : $ error = E_USER_ERROR ; break ; case E_WARNING : $ error = E_USER_WARNING ; break ; case E_NOTICE : $ error = E_USER_NOTICE ; break ; case E_DEPRECATED : $ error = E_USER_DEPRECATED ; break ; } return self :: isTrueUser ( $ error ) ; }
Converts an E_ERROR constant to the E_USER_ERROR equivalent

For example when given an E_WARNING constant value, the error is converted into
an E_USER_WARNING value. Not all E_ERROR constants have E_USER_ERROR equivalents.
In those cases the error remains unchanged, and the method returns false.

Returns whether the error is an E_USER_ERROR. Either before or after converting.

Examples:
```php
$error = E_ERROR;
$is_user = Errors::toUser($error);
var_dump($error);
var_dump($is_user);

// Outputs:
// 256 (E_USER_ERROR)
// bool(true)

$error = E_USER_WARNING;
$is_user = Errors::toUser($error);
var_dump($error);
var_dump($is_user);

// Outputs:
// 512 (E_USER_WARNING)
// bool(true)

$error = E_CORE_ERROR;
$is_user = Errors::toUser($error);
var_dump($error);
var_dump($is_user);

// Outputs:
// 16 (E_CORE_ERROR)
// bool(false)
```

@param  int $error The error to convert

@return bool
Converts an E_ERROR constant to the E_USER_ERROR equivalent