CoreFiles by mySites.guru
Unknown.php44 lines, 868 bytes, from wordpress-5.8.13.zip
Raw History Compare with 5.8.12
md5
22c58527c96b3fc03a7ea6e49011b7e8
sha1
83f435a85673629935b526428e56182392677898
sha256
307294cf98827b1dc2ecd98fc8b7ca294b9136b8640278b3ce31b62a2f96b09e
<?php
/**
 * Exception for unknown status responses
 *
 * @package Requests
 */

/**
 * Exception for unknown status responses
 *
 * @package Requests
 */
class Requests_Exception_HTTP_Unknown extends Requests_Exception_HTTP {
	/**
	 * HTTP status code
	 *
	 * @var integer|bool Code if available, false if an error occurred
	 */
	protected $code = 0;

	/**
	 * Reason phrase
	 *
	 * @var string
	 */
	protected $reason = 'Unknown';

	/**
	 * Create a new exception
	 *
	 * If `$data` is an instance of {@see Requests_Response}, uses the status
	 * code from it. Otherwise, sets as 0
	 *
	 * @param string|null $reason Reason phrase
	 * @param mixed $data Associated data
	 */
	public function __construct($reason = null, $data = null) {
		if ($data instanceof Requests_Response) {
			$this->code = $data->status_code;
		}

		parent::__construct($reason, $data);
	}
}

The same content is in 116 releases, WordPress 5.8-beta1 to 6.1.16. See them all, or every version of this file.