@param int $severity

@return null|string

@see http://php.net/manual/en/errorfunc.constants.php
543165
private function errorNameToCode($severity)
    {
        $all = array(
            'E_ERROR',
            'E_WARNING',
            'E_PARSE',
            'E_NOTICE',
            'E_CORE_ERROR',
            'E_CORE_WARNING',
            'E_COMPILE_ERROR',
            'E_COMPILE_WARNING',
            'E_USER_ERROR',
            'E_USER_WARNING',
            'E_USER_NOTICE',
            'E_RECOVERABLE_ERROR',
            'E_DEPRECATED',
            'E_USER_DEPRECATED',
        );

        foreach ($all as $name) {
            if (\defined($name) && \constant($name) === $severity) {
                return $name;
            }
        }

        return null;
    }
965996
private function getResponseErrorMessage($error)
    {
        $message = $error->message;

        if (isset($error->details) && is_array($error->details)) {
            foreach ($error->details as $detail) {
                $message .= implode(' - ', $detail->errors).' ['.$detail->error_type.' in '.$detail->parameter.'] ';
            }
        }

        return $message;
    }
106216
public function getError() : ?string 
    {
        if ( ! $this->hasError()) {
            $this->setError($this->getDefaultError());
        }
        return $this->error;
    }
282031
public function getErrorName($int)
    {
        if (!$this->_loaded) {
            $this->load();
        }
        if (!isset($this->errorNames[$int])) {
            return "[Error: $int]";
        }
        return $this->errorNames[$int];
    }
141338
function translateSeverity($severity)
    {
        if (is_array($this->severity_map) && isset($this->severity_map[$severity])) {
            return $this->severity_map[$severity];
        }
        switch ($severity) {
            case E_ERROR:              return Client::ERROR;
            case E_WARNING:            return Client::WARN;
            case E_PARSE:              return Client::ERROR;
            case E_NOTICE:             return Client::INFO;
            case E_CORE_ERROR:         return Client::ERROR;
            case E_CORE_WARNING:       return Client::WARN;
            case E_COMPILE_ERROR:      return Client::ERROR;
            case E_COMPILE_WARNING:    return Client::WARN;
            case E_USER_ERROR:         return Client::ERROR;
            case E_USER_WARNING:       return Client::WARN;
            case E_USER_NOTICE:        return Client::INFO;
            case E_STRICT:             return Client::INFO;
            case E_RECOVERABLE_ERROR:  return Client::ERROR;
        }
        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
            switch ($severity) {
            case E_DEPRECATED:         return Client::WARN;
            case E_USER_DEPRECATED:    return Client::WARN;
          }
        }
        return Client::ERROR;
    }
533353
private static function _mapSeverityNameToInt($severity)
    {
        /*
         * HACK: if() is a bit faster than switch()
         *       but switch() is more code readability :(
         */
        if ($severity === 'EMER') {
            return self::EMER;
        } else if ($severity === 'ALERT') {
            return self::ALERT;
        } else if ($severity === 'CRIT') {
            return self::CRIT;
        } else if ($severity === 'ERROR') {
            return self::ERROR;
        } else if ($severity === 'WARN') {
            return self::WARN;
        } else if ($severity === 'NOTICE') {
            return self::NOTICE;
        } else if ($severity === 'INFO') {
            return self::INFO;
        } else if ($severity === 'TIME') {
            return self::TIME;
        } else if ($severity === 'DEBUG') {
            return self::DEBUG;
        } else {
            return self::OFF;
        }
    }
556802
public function swrite($severity, $value='')
    {
        if(sizeof($this->cache) == $this->messageLimit) {
            array_shift($this->cache);
        }
        $this->cache[] = $value;
    }
910182
private function mapSeverity($severity)
    {
        if (empty($severity)) {
            throw new \InvalidArgumentException('Invalid severity string');
        }

        if (array_key_exists($severity, $this->severityMap)) {
            return $this->severityMap[$severity];
        }

        return $severity;
    }
1220762
protected function getSeverity($score)
    {
        foreach ($this->severityRatingScale as $level => $options) {
            if ($score >= $options['min_range'] && $score <= $options['max_range']) {
                return $level;
            }
        }
        return null;
    }
681275
protected function getMyWebShopSeverity($severity)
    {
        switch ($severity) {
            case Log::Error:
                return AbstractLogger::ERROR;
            case Log::Warning:
                return AbstractLogger::WARNING;
            case Log::Notice:
            case Log::Info:
                return AbstractLogger::INFO;
            case Log::Debug:
            default:
                return AbstractLogger::DEBUG;
        }
    }
631606
private function parseRefAsPull($reference): ?string
    {
        if (preg_match(self::REGEX_PULL, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[1];
    }
1155434
final public static function errorHandler($severity, $message, $filepath, $line)
	{
		$is_error = (((E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR) & $severity) === $severity);

		$level = self::$levels[$severity];

		$context = self::getContext(self::ERROR, $level, $message, $filepath, $line);

		if (!in_array($severity, array_merge([E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR], self::$ignore), true)) {

			error_log("{$level}: {$message} in {$filepath} in line {$line}");

			if (!empty(self::$logger)) {
				self::$logger->error("{$level}: {$message} in {$filepath} in line {$line}", $context);
			}
		}

		if ($is_error) {
			if (!empty(self::$logger)) {
				self::$logger->critical("{$level}: {$message} in {$filepath} in line {$line}", $context);
			}

			if (!is_null(self::$lastAction)) {
				$fn = self::$lastAction;
				$fn();
			}

			self::$httpHandler->overwrite(self::getErrorTemplate(self::$httpHandler, self::$defaultErrorPath))->withStatus(500)->send();
		}
	}
1031230
static Severity getSeverity(String severityName) {
        switch (severityName) {
        case "BLOCKER":
        case "CRITICAL":
        case "MAJOR":
            return Severity.ERROR;
        case "MINOR":
            return Severity.WARNING;
        case "INFO":
            return Severity.INFO;
        default:
          log.warn("Unknown severity: " + severityName);
        }
        return Severity.WARNING;
    }
155992
private function error($reason) {
		($r = $this->r()) ? df_sentry_extra($this, 'Request', $r) : null;
		throw new Critical($this->_m, $this, "The request is invalid because $reason.");
	}
391641
private function getQuotedParameterNormalisedError($htmlErrorString)
    {
        $parameterMatches = [];
        $matchCount = preg_match_all('/"([^"]?)+"/', $htmlErrorString, $parameterMatches);

        if ($matchCount === 0) {
            return null;
        }

        $normalisedError = new NormalisedError();
        $normalisedErrorString = $htmlErrorString;

        foreach ($parameterMatches[0] as $parameterIndex => $parameterMatch) {
            $normalisedErrorString = preg_replace(
                '/' . PregQuoter::quote($parameterMatch) . '/',
                '"%'.$parameterIndex.'"',
                $normalisedErrorString,
                1
            );
            $normalisedError->addParameter(trim($parameterMatch, '"'));
        }

        $normalisedError->setNormalForm($normalisedErrorString);

        return $normalisedError;
    }
904557
public function getErrorDescription(): string
    {
        if (isset(self::$errorReasons[$this->statusCode][$this->errorReason])) {
            return self::$errorReasons[$this->statusCode][$this->errorReason];
        }

        return '';
    }
183306
private function isError($severity)
    {
        return \in_array(
            $severity,
            [
                E_COMPILE_ERROR,
                E_CORE_ERROR,
                E_USER_ERROR,
                E_PARSE,
                E_ERROR,
            ],
            true
        );
    }