Returns a describing text for the last PREG error that happened.

@param null $code

@return string
778209
protected function getPregErrorText($code = null)
    {
        $code = $code ?: preg_last_error();

        if (!isset(self::$pregErrors[$code])) {
            $code = PREG_NO_ERROR;
        }

        return self::$pregErrors[$code];
    }
823824
public static function code($code = 200) : String
    {
        $messages = Datatype::multikey(self::$messages);

        if( isset($messages[$code]) )
        {
            return $messages[$code];
        }

        return false;
    }
210926
public function getFormattedString()
    {
        $string = (string) $this->code;

        if (null !== $this->message) {
            $string = $string . ' ' . $this->message;
        }

        return $string;
    }
619357
function error($code,$text='',array $trace=NULL,$level=0) {
		$prior=$this->hive['ERROR'];
		$header=$this->status($code);
		$req=$this->hive['VERB'].' '.$this->hive['PATH'];
		if ($this->hive['QUERY'])
			$req.='?'.$this->hive['QUERY'];
		if (!$text)
			$text='HTTP '.$code.' ('.$req.')';
		$trace=$this->trace($trace);
		$loggable=$this->hive['LOGGABLE'];
		if (!is_array($loggable))
			$loggable=$this->split($loggable);
		foreach ($loggable as $status)
			if ($status=='*' ||
				preg_match('/^'.preg_replace('/\D/','\d',$status).'$/',$code)) {
				error_log($text);
				foreach (explode("\n",$trace) as $nexus)
					if ($nexus)
						error_log($nexus);
				break;
			}
		if ($highlight=!$this->hive['CLI'] && !$this->hive['AJAX'] &&
			$this->hive['HIGHLIGHT'] && is_file($css=__DIR__.'/'.self::CSS))
			$trace=$this->highlight($trace);
		$this->hive['ERROR']=[
			'status'=>$header,
			'code'=>$code,
			'text'=>$text,
			'trace'=>$trace,
			'level'=>$level
		];
		$this->expire(-1);
		$handler=$this->hive['ONERROR'];
		$this->hive['ONERROR']=NULL;
		$eol="\n";
		if ((!$handler ||
			$this->call($handler,[$this,$this->hive['PARAMS']],
				'beforeroute,afterroute')===FALSE) &&
			!$prior && !$this->hive['CLI'] && !$this->hive['QUIET'])
			echo $this->hive['AJAX']?
				json_encode(
					array_diff_key(
						$this->hive['ERROR'],
						$this->hive['DEBUG']?
							[]:
							['trace'=>1]
					)
				):
				('<!DOCTYPE html>'.$eol.
				'<html>'.$eol.
				'<head>'.
					'<title>'.$code.' '.$header.'</title>'.
					($highlight?
						('<style>'.$this->read($css).'</style>'):'').
				'</head>'.$eol.
				'<body>'.$eol.
					'<h1>'.$header.'</h1>'.$eol.
					'<p>'.$this->encode($text?:$req).'</p>'.$eol.
					($this->hive['DEBUG']?('<pre>'.$trace.'</pre>'.$eol):'').
				'</body>'.$eol.
				'</html>');
		if ($this->hive['HALT'])
			die(1);
	}
341727
protected static function getErrorMessage($code)
    {
        $string = socket_strerror($code);

        // search constant starting with SOCKET_ for this error code
        foreach (get_defined_constants() as $key => $value) {
            if($value === $code && strpos($key, 'SOCKET_') === 0) {
                $string .= ' (' . $key . ')';
                break;
            }
        }

        return $string;
    }
672868
public static function getHierarchyChildLength($code)
    {
        $lengths = static::getHierarchyLengths();
        if ($code === '') {
            return $lengths[0];
        }

        $current_length = 0;
        $code_length = strlen($code);
        foreach ($lengths as $i => $length) {
            $current_length += $length;
            if ($current_length === $code_length) {
                if ($i >= count($lengths) - 1) {
                    return -1;
                } else {
                    return $current_length + $lengths[$i + 1];
                }
            }
        }

        return -1;
    }
258930
public static function getReason($code, $default = null)
    {
        $code = (int) $code;
        
        if (array_key_exists($code, static::$webDavStatusMessages)) {
            return static::$webDavStatusMessages[$code];
        }
        
        return parent::getReason($code, $default);
    }
1292702
public static function getPhrase(int $code):string
    {
        if (isset(self::$response[$code])) {
            return (self::$response[$code]);
        } else {
            throw new Server500(new \ArrayObject(array("explain" => "Http code does not exist",
                "solution" => "Please check your http code")));
        }
    }
170790
public function getMessageString($errorCode)
	{
		return isset($this->errorMessages[$errorCode]) ? $this->errorMessages[$errorCode] : null;
	}
192260
protected function getLogLevel($code = null)
    {
        switch ($code) {
            case E_STRICT:
            case E_DEPRECATED:
            case E_USER_DEPRECATED:
                return LogLevel::INFO;
            
            case E_NOTICE:
            case E_USER_NOTICE:
                return LogLevel::NOTICE;
                
            case E_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_WARNING:
                return LogLevel::WARNING;
            
            case E_PARSE:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
                return LogLevel::CRITICAL;
            
            default:
                return LogLevel::ERROR;
        }
    }
241649
protected function getErrorByCode($code, $optional = '')
    {
        $error = new Error($code);
        $code = preg_replace(self::NUMBER_PATTERN, '', $code);
        $message = '';

        if (empty($code) && $optional) {
            $code = preg_replace(self::NUMBER_PATTERN, '', $optional);
        }

        if ($code) {
            $message = $this->getMessageError($code);
            $error->setCode($code);
        }

        return $error->setMessage($message);
    }
331228
protected function getExpectedCode()
    {
        $options = $this->session->get($this->key, array());

        if (is_array($options) && isset($options['phrase'])) {
            return $options['phrase'];
        }

        return null;
    }
319186
static public function getText( $code ){
		if( !array_key_exists( (int) $code, self::$codes ) )
			throw new InvalidArgumentException( 'Unknown HTTP status code: '.$code );
		return self::$codes[(int) $code];
	}
912273
public static function getMessageByCode(int $code): string
    {
        return (array_key_exists($code, self::MESSAGES)) ? self::MESSAGES[$code] : self::MESSAGES[self::UNKNOWN_ERROR];
    }
765198
public function invoices($code = null)
    {
        if (! $code) {
            $code = $this->data->code;
        }

        return $this->client->get('/{code}/invoices', [$code])
                            ->setDataKey('invoices')
                            ->getResults();
    }
1145117
public static function getStatusMessage($code) {
		if (!$code) {
			return '';
		}

		return isset(self::$statusMessages[$code]) ? self::$statusMessages[$code] : '';
	}
171304
public static function message($code)
    {
        if (array_key_exists($code, self::$messages)) {
            return self::$messages[$code];
        }

        return null;
    }