From d45b4289c722ac337f8a29063906e11b7d6413b4 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 13 Mar 2024 19:38:20 +0100 Subject: [PATCH] Add missing types --- Trustly/Api/api.php | 9 ++++++++- Trustly/Api/signed.php | 2 ++ Trustly/Data/data.php | 6 ++++-- Trustly/exceptions.php | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Trustly/Api/api.php b/Trustly/Api/api.php index c9fee7d..19bbcd7 100644 --- a/Trustly/Api/api.php +++ b/Trustly/Api/api.php @@ -252,6 +252,8 @@ public function verifyTrustlySignedNotification($notification) { * * @param bool $is_https Indicator wether the port on the API host expects * https. NULL means do not change. + * + * @return void */ public function setHost($host=NULL, $port=NULL, $is_https=NULL) { if(!isset($host)) { @@ -279,7 +281,7 @@ public function setHost($host=NULL, $port=NULL, $is_https=NULL) { * * @param string $postdata The (optional) data to post. * - * @return Array($body, $response_code) + * @return array{string, int} Array($body, $response_code) */ public function post($url=NULL, $postdata=NULL) { /* Do note that that if you are going to POST JSON you need to set the @@ -465,6 +467,7 @@ public function notificationResponse($request, $success=TRUE) { * * @param Trustly_Data_Request $request Outgoing data request. * + * @return Trustly_Data_JSONRPCResponse */ public function call($request) { if($this->insertCredentials($request) !== TRUE) { @@ -524,6 +527,8 @@ abstract protected function urlPath($request=NULL); * @param string $body The body recieved in response to the request * * @param integer $response_code the HTTP response code for the call + * + * @return Trustly_Data_JSONRPCResponse */ abstract protected function handleResponse($request, $body, $response_code); @@ -535,6 +540,8 @@ abstract protected function handleResponse($request, $body, $response_code); * * @param Trustly_Data_Request $request Request to be used in the outgoing * call + * + * @return bool */ abstract protected function insertCredentials($request); diff --git a/Trustly/Api/signed.php b/Trustly/Api/signed.php index 69d0b5b..32824ec 100644 --- a/Trustly/Api/signed.php +++ b/Trustly/Api/signed.php @@ -251,6 +251,8 @@ protected function urlPath($request=NULL) { /** * Quirks mode implementation of clearing all pending openssl error messages. + * + * @return void */ private function clearOpenSSLError() { /* Not really my favourite part of this library implementation. As diff --git a/Trustly/Data/data.php b/Trustly/Data/data.php index a77274b..9fb0351 100644 --- a/Trustly/Data/data.php +++ b/Trustly/Data/data.php @@ -37,7 +37,7 @@ class Trustly_Data { /** * Data payload - * @var array + * @var array */ protected $payload = NULL; @@ -179,7 +179,9 @@ public function json($pretty=FALSE) { * pretty printer * * @param mixed $data Payload to sort. Will be sorted in place - * */ + * + * @return void + */ private function sortRecursive(&$data) { if(is_array($data)) { foreach($data as $k => $v) { diff --git a/Trustly/exceptions.php b/Trustly/exceptions.php index e1a9724..da8e318 100644 --- a/Trustly/exceptions.php +++ b/Trustly/exceptions.php @@ -65,6 +65,8 @@ public function __construct($message, $data=NULL) { * Get the data that had an invalid signature. This is the only way to get * data from anything with a bad signature. This should be used for * DEBUGGING ONLY. You should NEVER rely on the contents. + * + * @return mixed */ public function getBadData() { return $this->signature_data;