diff options
author | Oleksandr Zahorulia <Hast4656@gmail.com> | 2016-09-30 22:50:50 +0300 |
---|---|---|
committer | Marco Ceppi <marco@ceppi.net> | 2016-09-30 21:50:50 +0200 |
commit | d8ef0dba1fa378fc22fe6d423f9423febb2d996d (patch) | |
tree | 125e225306ac315f85f6f950e6e1ac1e72f804d8 /Auth/OpenID/Server.php | |
parent | 924f9aa42453cd0f9dba72587b4e2cdf7f4de874 (diff) | |
download | php-openid-origin/HEAD.zip php-openid-origin/HEAD.tar.gz php-openid-origin/HEAD.tar.bz2 |
#130: PHP 7 compatibility (fixes #129)HEADorigin/masterorigin/HEADmaster
Diffstat (limited to 'Auth/OpenID/Server.php')
-rw-r--r-- | Auth/OpenID/Server.php | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php index 9887d1e..5984c00 100644 --- a/Auth/OpenID/Server.php +++ b/Auth/OpenID/Server.php @@ -148,7 +148,7 @@ class Auth_OpenID_ServerError { /** * @access private */ - function Auth_OpenID_ServerError($message = null, $text = null, + function __construct($message = null, $text = null, $reference = null, $contact = null) { $this->message = $message; @@ -292,10 +292,10 @@ class Auth_OpenID_ServerError { * @package OpenID */ class Auth_OpenID_NoReturnToError extends Auth_OpenID_ServerError { - function Auth_OpenID_NoReturnToError($message = null, + function __construct($message = null, $text = "No return_to URL available") { - parent::Auth_OpenID_ServerError($message, $text); + parent::__construct($message, $text); } function toString() @@ -310,10 +310,10 @@ class Auth_OpenID_NoReturnToError extends Auth_OpenID_ServerError { * @package OpenID */ class Auth_OpenID_MalformedReturnURL extends Auth_OpenID_ServerError { - function Auth_OpenID_MalformedReturnURL($message, $return_to) + function __construct($message, $return_to) { $this->return_to = $return_to; - parent::Auth_OpenID_ServerError($message, "malformed return_to URL"); + parent::__construct($message, "malformed return_to URL"); } } @@ -323,10 +323,10 @@ class Auth_OpenID_MalformedReturnURL extends Auth_OpenID_ServerError { * @package OpenID */ class Auth_OpenID_MalformedTrustRoot extends Auth_OpenID_ServerError { - function Auth_OpenID_MalformedTrustRoot($message = null, + function __construct($message = null, $text = "Malformed trust root") { - parent::Auth_OpenID_ServerError($message, $text); + parent::__construct($message, $text); } function toString() @@ -353,7 +353,7 @@ class Auth_OpenID_CheckAuthRequest extends Auth_OpenID_Request { var $mode = "check_authentication"; var $invalidate_handle = null; - function Auth_OpenID_CheckAuthRequest($assoc_handle, $signed, + function __construct($assoc_handle, $signed, $invalidate_handle = null) { $this->assoc_handle = $assoc_handle; @@ -463,7 +463,7 @@ class Auth_OpenID_DiffieHellmanSHA1ServerSession { var $allowed_assoc_types = array('HMAC-SHA1'); var $hash_func = 'Auth_OpenID_SHA1'; - function Auth_OpenID_DiffieHellmanSHA1ServerSession($dh, $consumer_pubkey) + function __construct($dh, $consumer_pubkey) { $this->dh = $dh; $this->consumer_pubkey = $consumer_pubkey; @@ -590,7 +590,7 @@ class Auth_OpenID_AssociateRequest extends Auth_OpenID_Request { 'DH-SHA256' => 'Auth_OpenID_DiffieHellmanSHA256ServerSession'); } - function Auth_OpenID_AssociateRequest($session, $assoc_type) + function __construct($session, $assoc_type) { $this->session = $session; $this->namespace = Auth_OpenID_OPENID2_NS; @@ -763,7 +763,7 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request { } } - function Auth_OpenID_CheckIDRequest($identity, $return_to, + function __construct($identity, $return_to, $trust_root = null, $immediate = false, $assoc_handle = null, $server = null, $claimed_id = null) @@ -1184,7 +1184,7 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request { */ class Auth_OpenID_ServerResponse { - function Auth_OpenID_ServerResponse($request) + function __construct($request) { $this->request = $request; $this->fields = new Auth_OpenID_Message($this->request->namespace); @@ -1271,7 +1271,7 @@ class Auth_OpenID_WebResponse { var $code = AUTH_OPENID_HTTP_OK; var $body = ""; - function Auth_OpenID_WebResponse($code = null, $headers = null, + function __construct($code = null, $headers = null, $body = null) { if ($code) { @@ -1311,7 +1311,7 @@ class Auth_OpenID_Signatory { /** * Create a new signatory using a given store. */ - function Auth_OpenID_Signatory($store) + function __construct($store) { // assert store is not None $this->store = $store; @@ -1483,7 +1483,7 @@ class Auth_OpenID_Encoder { */ class Auth_OpenID_SigningEncoder extends Auth_OpenID_Encoder { - function Auth_OpenID_SigningEncoder($signatory) + function __construct($signatory) { $this->signatory = $signatory; } @@ -1521,7 +1521,7 @@ class Auth_OpenID_SigningEncoder extends Auth_OpenID_Encoder { */ class Auth_OpenID_Decoder { - function Auth_OpenID_Decoder($server) + function __construct($server) { $this->server = $server; @@ -1604,9 +1604,11 @@ class Auth_OpenID_Decoder { * @package OpenID */ class Auth_OpenID_EncodingError { - function Auth_OpenID_EncodingError($response) + function __construct($response = null) { - $this->response = $response; + if ($response !== null) { + $this->response = $response; + } } } @@ -1616,7 +1618,7 @@ class Auth_OpenID_EncodingError { * @package OpenID */ class Auth_OpenID_AlreadySigned extends Auth_OpenID_EncodingError { - // This response is already signed. + } /** @@ -1626,10 +1628,10 @@ class Auth_OpenID_AlreadySigned extends Auth_OpenID_EncodingError { * @package OpenID */ class Auth_OpenID_UntrustedReturnURL extends Auth_OpenID_ServerError { - function Auth_OpenID_UntrustedReturnURL($message, $return_to, + function __construct($message, $return_to, $trust_root) { - parent::Auth_OpenID_ServerError($message, "Untrusted return_to URL"); + parent::__construct($message, "Untrusted return_to URL"); $this->return_to = $return_to; $this->trust_root = $trust_root; } @@ -1679,7 +1681,7 @@ class Auth_OpenID_UntrustedReturnURL extends Auth_OpenID_ServerError { * @package OpenID */ class Auth_OpenID_Server { - function Auth_OpenID_Server($store, $op_endpoint=null) + function __construct($store, $op_endpoint=null) { $this->store = $store; $this->signatory = new Auth_OpenID_Signatory($this->store); |