returns reason phrase for given status code

@api
@param   int  $statusCode
@return  string
@throws  \InvalidArgumentException
@since   4.0.0
195544
public static function reasonPhraseFor(int $statusCode): string
    {
        if (isset(self::$reasonPhrases[$statusCode])) {
            return self::$reasonPhrases[$statusCode];
        }

        throw new \InvalidArgumentException(
                'Invalid or unknown HTTP status code ' . $statusCode
        );
    }
1084445
public static function get_content_for_errorcode($statusCode)
    {
        if (!self::config()->enable_static_file) {
            return null;
        }

        // Attempt to retrieve content from generated file handler
        $filename = self::get_error_filename($statusCode);
        $storeFilename = File::join_paths(
            self::config()->store_filepath,
            $filename
        );
        return self::get_asset_handler()->getContent($storeFilename);
    }
82044
public static function rpcCodeFromHttpStatusCode($httpStatusCode)
    {
        if (array_key_exists($httpStatusCode, self::$httpStatusCodeToRpcCodeMap)) {
            return self::$httpStatusCodeToRpcCodeMap[$httpStatusCode];
        }
        return ApiStatus::UNRECOGNIZED_CODE;
    }
111318
protected function parseError($statusCode)
    {
        return isset($this->errors[$statusCode]) ? $this->errors[$statusCode] : $this->errors['x'];
    }
1320990
public static function get(int $code): string {

        if ( array_key_exists($code, self::ZIP_STATUS_CODES) ) return self::ZIP_STATUS_CODES[$code];

        else return sprintf('Unknown status %s', $code);

    }
1022672
private function isError($statusCode)
    {
        if ($this->statusCodeValidator) {
            return call_user_func($this->statusCodeValidator, $statusCode);
        }

        return $statusCode >= 400 && $statusCode < 600;
    }
1188416
public static function getErrorDescription($errorCode)
    {
        switch (intval($errorCode)) {
            default:
            case self::ERROR:
                return 'Undefined error.';
            case self::SYSTEM_ERROR:
                return 'A general system error occurred.';
            case self::MAINTENANCE_ERROR:
                return 'System is undergoing maintenance, request could not be handled.';
            case self::AUTHENTICATION_ERROR:
                return 'Login failed. Check your API credentials.';
            case self::CONFIGURATION_ERROR:
                return 'Config error occurred, e.g. terminal not configured properly. Check terminal settings.';
            case self::COMMUNICATION_ERROR:
                return 'Communication with issuer failed, please contact support.';
            case self::CONNECTION_ERROR:
                return 'Connection to issuer could not be established, please contact support.';
            case self::ACCOUNT_ERROR:
                return 'Issuer account data invalid, please contact support.';
            case self::TIMEOUT_ERROR:
                return 'Issuer does not respond within given time-frame - please reconcile.';
            case self::RESPONSE_ERROR:
                return 'Issuer returned invalid response - please reconcile and contact support.';
            case self::PARSING_ERROR:
                return 'Issuer response could not be parsed - please reconcile and contact support.';
            case self::INPUT_DATA_ERROR:
                return 'Invalid were data sent to the API.';
            case self::INVALID_TRANSACTION_TYPE_ERROR:
                return 'Invalid transaction type was passed to API.';
            case self::INPUT_DATA_MISSING_ERROR:
                return 'Required argument is missing.';
            case self::INPUT_DATA_FORMAT_ERROR:
                return 'Argument passed in invalid format.';
            case self::MASTERCARD_FORMAT_ERROR:
                return 'This is a format error stopped by MasterCard due to invalid formatting in certain fields.';
            case self::INPUT_DATA_INVALID_ERROR:
                return 'Argument passed in valid format but makes no sense (e.g. incorrect country code or currency).';
            case self::INVALID_XML_ERROR:
                return 'The input Builder could not be parsed due to invalid code.';
            case self::INVALID_CONTENT_TYPE_ERROR:
                return 'Missing or invalid content type: should be text/xml!';
            case self::WORKFLOW_ERROR:
                return 'A transaction was triggered that is not possible at this time in the workflow,' .
                       'e.g. a refund on a declined transaction.';
            case self::REFERENCE_NOT_FOUND_ERROR:
                return 'Reference transaction was not found.';
            case self::REFERENCE_WORKFLOW_ERROR:
                return 'Wrong Workflow specified.';
            case self::REFERENCE_INVALIDATED_ERROR:
                return 'Reference transaction already invalidated!';
            case self::REFERENCE_MISMATCH_ERROR:
                return 'Data mismatch with reference, e.g. amount exceeds reference.';
            case self::DOUBLE_TRANSACTION_ERROR:
                return 'Transaction doublet was detected, transaction was blocked.';
            case self::TRANSACTION_NOT_FOUND_ERROR:
                return 'The referenced transaction could not be found.';
            case self::CHARGEBACK_NOT_FOUND_ERROR:
                return 'Chargeback not found!';
            case self::RETRIEVAL_REQUEST_NOT_FOUND_ERROR:
                return 'Retrieval Request not found!';
            case self::FRAUD_REPORT_NOT_FOUND_ERROR:
                return 'Fraud Report not found!';
            case self::PROCESSING_ERROR:
                return 'Transaction declined by issuer.';
            case self::INVALID_CARD_ERROR:
                return 'Transaction declined, Credit card number is invalid.';
            case self::ISSUER_OCT_NOT_ENABLED_ERROR:
                return 'OCT not enabled error.';
            case self::EXPIRED_CARD_ERROR:
                return 'Transaction declined, expiration date not in the future or date invalid.';
            case self::TRANSACTION_PENDING_ERROR:
                return 'Transaction pending.';
            case self::CREDIT_EXCEEDED_ERROR:
                return 'Amount exceeds credit card limit.';
            case self::ISSUING_ERROR:
                return 'The voucher could not be issued!';
            case self::RISK_ERROR:
                return 'Transaction declined by risk management.';
            case self::INTERCHANGE_REJECT_ERROR:
                return 'Interchange reject received for transaction!';
            case self::FRONT_END_REJECT_ERROR:
                return 'Transaction declined by frontend reject!';
            case self::BIN_COUNTRY_CHECK_ERROR:
                return 'Card bin does not match billing country.';
            case self::CARD_BLACKLIST_ERROR:
                return 'Card is blacklisted.';
            case self::BIN_BLACKLIST_ERROR:
                return 'BIN blacklisted.';
            case self::COUNTRY_BLACKLIST_ERROR:
                return 'Country blacklisted.';
            case self::IP_BLACKLIST_ERROR:
                return 'IP address blacklisted.';
            case self::BLACKLIST_ERROR:
                return 'Value from the Transaction Request or Risk Parameters is blacklisted.';
            case self::CARD_WHITELIST_ERROR:
                return 'PAN Whitelist Filter blocked the transaction.';
            case self::CARD_LIMIT_EXCEEDED_ERROR:
                return 'Card limit exceeded configured limits.';
            case self::TERMINAL_LIMIT_EXCEEDED_ERROR:
                return 'Terminal limits exceeded.';
            case self::CONTRACT_LIMIT_EXCEEDED_ERROR:
                return 'MID limits exceeded.';
            case self::CARD_VELOCITY_EXCEEDED_ERROR:
                return 'Velocity by unknown card exceeded!';
            case self::CARD_TICKET_SIZE_EXCEEDED_ERROR:
                return 'Ticket size by unknown card exceeded!';
            case self::USER_LIMIT_EXCEEDED_ERROR:
                return 'User limit exceeded configured limits.';
            case self::MULTIPLE_FAILURE_DETECTION_ERROR:
                return 'Found user transaction declined by issuer.';
            case self::CS_DETECTION_ERROR:
                return 'CrossSelling Error!';
            case self::RECURRING_LIMIT_EXCEEDED_ERROR:
                return 'Amount/count by recurring subscription exceeded.';
            case self::IRIS_FILTER_DECLINED_ERROR:
                return 'Transaction declined by risk management.';
            case self::IRIS_FILTER_ON_HOLD_ERROR:
                return 'Transaction on hold, a manual review will be done';
            case self::AVS_ERROR:
                return 'Address Verification failed.';
            case self::MAX_MIND_RISK_ERROR:
                return 'MaxMind High Risk Error.';
            case self::THREAT_METRIX_RISK_ERROR:
                return 'ThreatMetrix High Risk Error.';
            case self::IP_NOT_WHITELISTED_ERROR:
                return 'Transaction declined by risk management, IP is NOT whitelisted!';
            case self::DOMAIN_BLACKLISTED_ERROR:
                return 'Transaction declined by risk management, domain is blacklisted!';
            case self::FRAUD_ERROR:
                return 'Please contact the risk team!';
            case self::IBAN_BLACKLIST_ERROR:
                return 'Transaction declined by risk management, iban blacklisted!';
            case self::REMOTE_ERROR:
                return 'Some error occurred on the issuer.';
            case self::REMOTE_SYSTEM_ERROR:
                return 'Some error occurred on the issuer.';
            case self::REMOTE_CONFIGURATION_ERROR:
                return 'Issuer configuration error.';
            case self::REMOTE_DATA_ERROR:
                return 'Some passed data caused an error on the issuer.';
            case self::REMOTE_WORKFLOW_ERROR:
                return 'Remote workflow error.';
            case self::REMOTE_TIMEOUT_ERROR:
                return 'Issuer has time-out with clearing network.';
            case self::REMOTE_CONNECTION_ERROR:
                return 'Issuer could not reach clearing network.';
        }
    }
1091019
public function setStatusCode(int $statusCode, string $statusText = null)
    {
        $this->statusCode = $statusCode;

        if ($statusText === null && isset(ResponseHeaders::$statusTexts[$statusCode])) {
            $this->statusText = ResponseHeaders::$statusTexts[$statusCode];
        } else {
            $this->statusText = $statusText;
        }
    }
999150
public static function getDefaultStatusMessage($statusCode)
	{
		$statusCode = (int) $statusCode;
		
		if (isset(self::$_defaultStatusMessages[$statusCode]))
		{
			return self::$_defaultStatusMessages[$statusCode];
		}
		
		return "Unknown Status";
	}
568683
public function getDescriptionByStatusCode($code)
    {
        // Make sure the expected type supplied
        $code = (int) $code;

        if (isset($this->statuses[$code])) {
            return $this->statuses[$code];
        } else {
            throw new OutOfRangeException(
                sprintf('The status code "%s" is out of allowed range', $code)
            );
        }
    }
339156
public function withStatus($code, $reasonPhrase = '')
    {
        $this->statusCode = (int)$code;
        if ($reasonPhrase == '') {
            $this->reasonPhrase = Status::getReasonPhrase($this->statusCode);
        } else {
            $this->reasonPhrase = $reasonPhrase;
        }

        return $this;
    }
136304
public static function getStatusIdList($statusCode)
    {
        if (! isset(self::$statusIdListsCache[$statusCode])) {
            $statusIdList = [];

            $statusList = OrderStatusQuery::create()->find();

            /** @var OrderStatus $status */
            foreach ($statusList as $status) {
                switch ($statusCode) {
                    case OrderStatus::CODE_NOT_PAID:
                        $match = $status->isNotPaid(false);
                        break;
                    case OrderStatus::CODE_PAID:
                        $match = $status->isPaid(false);
                        break;

                    case OrderStatus::CODE_PROCESSING:
                        $match = $status->isProcessing(false);
                        break;

                    case OrderStatus::CODE_SENT:
                        $match = $status->isSent(false);
                        break;
                    case OrderStatus::CODE_CANCELED:
                        $match = $status->isCancelled(false);
                        break;
                    case OrderStatus::CODE_REFUNDED:
                        $match = $status->isRefunded(false);
                        break;

                    default:
                        throw new InvalidArgumentException("Status code '$statusCode' is not a valid value.");
                }

                if ($match) {
                    $statusIdList[] = $status->getId();
                }
            }

            self::$statusIdListsCache[$statusCode] = $statusIdList;
        }

        return self::$statusIdListsCache[$statusCode];
    }
889095
function status($code) {
		$reason=@constant('self::HTTP_'.$code);
		if (!$this->hive['CLI'] && !headers_sent())
			header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);
		return $reason;
	}
217167
public function setStatus(int $statusCode): void
    {
        if (!isset($this->statusMessages[$statusCode])) {
            throw new \InvalidArgumentException('Invalid HTTP status code.');
        }
        $this->statusCode = $statusCode;
    }
1335684
function status($code) {
		$reason=@constant('self::HTTP_'.$code);
		if (PHP_SAPI!='cli')
			header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);
		return $reason;
	}
921826
public function getStatus($includeStatusCode = false)
    {
        if (!isset($this->data->status))
            return null;
        return ($includeStatusCode) ? sprintf("%s: %s", $this->data->status, $this->data->statusCode) : $this->data->status;
    }
1299729
public function setStatusCode($statusCode, $text = null)
    {
        // Fallback status code message if missing
        if (! empty($text)) {
            $statusText = $text;
        } elseif (! empty(self::$statusTexts[$statusCode])) {
            $statusText = self::$statusTexts[$statusCode];
        } else {
            $statusText = 'Undefined code';
        }

        // Set status code and text
        $this->statusCode = $statusCode;
        $this->statusText = $statusText;

        // Validate status code
        if ($this->isInvalid()) {
            throw new InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $statusCode));
        }

        return $this;
    }