CoreFiles by mySites.guru
Unknown.php44 lines, 867 bytes, from wordpress-4.9.21.zip
Raw History Compare with 4.9.20
md5
da646c02e1ab81b632af41fbcf0a57ac
sha1
6878dad9cdbef933fe2902460334b0a38ae841ce
sha256
5d189625a0c3191bf16a7834a4cc3ba5f845c8aace3ed032fe8249c899124395
<?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 481 releases, WordPress 4.6-beta1 to 5.7.21. See them all, or every version of this file.