diff --git a/Trustly/Api/api.php b/Trustly/Api/api.php index c9fee7d..ab53a18 100644 --- a/Trustly/Api/api.php +++ b/Trustly/Api/api.php @@ -44,13 +44,13 @@ abstract class Trustly_Api { * * @var string FQHN */ - protected $api_host = NULL; + protected $api_host; /** * API port used for communication. * * @var integer Normally either 443 (https) or 80 (http) */ - protected $api_port = NULL; + protected $api_port; /** * Inidicator wether the API host is communicating using https * @@ -63,7 +63,7 @@ abstract class Trustly_Api { * * @see Trustly_Api::getLastRequest() * - * @var array Last API call in data form. + * @var ?Trustly_Data_Request Last API call in data form. */ public $last_request = NULL; @@ -404,7 +404,7 @@ public function url($request=NULL) { /** * Return the last request that we attempted to make via this API * - * @return array Last request data structure. + * @return ?Trustly_Data_Request Last request data structure. */ public function getLastRequest() { return $this->last_request; diff --git a/Trustly/Api/signed.php b/Trustly/Api/signed.php index 69d0b5b..8d03c79 100644 --- a/Trustly/Api/signed.php +++ b/Trustly/Api/signed.php @@ -37,7 +37,7 @@ class Trustly_Api_Signed extends Trustly_Api { /** * Loaded merchant private key resource - * @var resource from openssl with the loaded privatekey + * @var mixed from openssl with the loaded privatekey */ private $merchant_privatekey = NULL; @@ -70,7 +70,7 @@ public function __construct($merchant_privatekey, $username, $password, $host='t parent::__construct($host, $port, $is_https); $this->api_username = $username; - $this->api_password = $password; + $this->api_password = $password; if($merchant_privatekey != NULL) { if(strpos($merchant_privatekey, "\n") !== FALSE) { if($this->useMerchantPrivateKey($merchant_privatekey) === FALSE) { diff --git a/Trustly/Api/unsigned.php b/Trustly/Api/unsigned.php index c62d6b9..d31841e 100644 --- a/Trustly/Api/unsigned.php +++ b/Trustly/Api/unsigned.php @@ -41,16 +41,16 @@ class Trustly_Api_Unsigned extends Trustly_Api { * newSessionCookie after which the $session_uuid is used instead. * @var string */ - private $api_username = NULL; + private $api_username; /** * Login password when using the API. Used only in the first API call to * newSessionCookie after which the $session_uuid is used instead. * @var string */ - private $api_password = NULL; + private $api_password; /** * Session UUID used for authenticating calls. - * @var string + * @var ?string */ private $session_uuid = NULL; diff --git a/Trustly/Data/data.php b/Trustly/Data/data.php index a77274b..26bf288 100644 --- a/Trustly/Data/data.php +++ b/Trustly/Data/data.php @@ -39,15 +39,7 @@ class Trustly_Data { * Data payload * @var array */ - protected $payload = NULL; - - /** - * Constructur. - */ - public function __construct() { - $this->payload = array(); - } - + protected $payload = array(); /** * Utility function to vacuum the supplied data end remove unset diff --git a/Trustly/Data/jsonrpcnotificationrequest.php b/Trustly/Data/jsonrpcnotificationrequest.php index 6be3c5f..4d31a51 100644 --- a/Trustly/Data/jsonrpcnotificationrequest.php +++ b/Trustly/Data/jsonrpcnotificationrequest.php @@ -40,7 +40,7 @@ class Trustly_Data_JSONRPCNotificationRequest extends Trustly_Data { * The RAW incoming notification body * @var string */ - var $notification_body = NULL; + public $notification_body; /** @@ -55,8 +55,6 @@ class Trustly_Data_JSONRPCNotificationRequest extends Trustly_Data { * @param string $notification RAW incoming notification body */ public function __construct($notification_body) { - parent::__construct(); - $this->notification_body = $notification_body; if(empty($notification_body)) { diff --git a/Trustly/Data/jsonrpcnotificationresponse.php b/Trustly/Data/jsonrpcnotificationresponse.php index 87894a8..260c699 100644 --- a/Trustly/Data/jsonrpcnotificationresponse.php +++ b/Trustly/Data/jsonrpcnotificationresponse.php @@ -46,9 +46,6 @@ class Trustly_Data_JSONRPCNotificationResponse extends Trustly_Data { * was successfully processed. */ public function __construct($request, $success=NULL) { - - parent::__construct(); - $uuid = $request->getUUID(); $method = $request->getMethod(); diff --git a/Trustly/Data/request.php b/Trustly/Data/request.php index 3daaca7..3acfc7c 100644 --- a/Trustly/Data/request.php +++ b/Trustly/Data/request.php @@ -38,7 +38,7 @@ class Trustly_Data_Request extends Trustly_Data { * Call method name * @var string */ - var $method = NULL; + public $method = NULL; /** * Constructor. @@ -48,8 +48,6 @@ class Trustly_Data_Request extends Trustly_Data { * @param array $payload Call payload */ public function __construct($method=NULL, $payload=NULL) { - parent::__construct(); - $vpayload = $this->vacuum($payload); if(isset($vpayload)) { $this->payload = $vpayload; diff --git a/Trustly/Data/response.php b/Trustly/Data/response.php index 0f4b97b..bec823e 100644 --- a/Trustly/Data/response.php +++ b/Trustly/Data/response.php @@ -37,21 +37,21 @@ class Trustly_Data_Response extends Trustly_Data { /** * Raw copy of the incoming response body - * @var integer + * @var ?string */ - var $response_body = NULL; + public $response_body = NULL; /** * The response HTTP code - * @var integer + * @var ?integer */ - var $response_code = NULL; + public $response_code = NULL; /** * Shortcut to the part of the result being actually interesting. The guts will contain all returned data. * @var mixed */ - var $response_result = NULL; + public $response_result = NULL; /** @@ -67,8 +67,6 @@ class Trustly_Data_Response extends Trustly_Data { * @param integer $response_code HTTP response code from the API call */ public function __construct($response_body, $response_code=NULL) { - parent::__construct(); - $this->response_code = $response_code; $this->response_body = $response_body;