From 035043fa3333165e8509f1de08f305161824b1e9 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 13 Mar 2024 15:08:06 +0100 Subject: [PATCH] Correct signature of nullable arguments --- Trustly/Api/api.php | 22 +++++------ Trustly/Api/signed.php | 40 ++++++++++---------- Trustly/Api/unsigned.php | 14 +++---- Trustly/Data/data.php | 2 +- Trustly/Data/jsonrpcnotificationrequest.php | 4 +- Trustly/Data/jsonrpcnotificationresponse.php | 8 ++-- Trustly/Data/jsonrpcrequest.php | 4 +- Trustly/Data/jsonrpcsignedresponse.php | 2 +- Trustly/Data/request.php | 4 +- Trustly/Data/response.php | 4 +- Trustly/exceptions.php | 2 +- 11 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Trustly/Api/api.php b/Trustly/Api/api.php index c9fee7d..6905e83 100644 --- a/Trustly/Api/api.php +++ b/Trustly/Api/api.php @@ -167,11 +167,11 @@ public function serializeData($data) { * * @link https://eu.developers.trustly.com/doc/reference/authentication * - * @param string $method Method in the API call + * @param ?string $method Method in the API call * - * @param string $uuid UUID in the API call + * @param ?string $uuid UUID in the API call * - * @param string $signature in the API call + * @param ?string $signature in the API call * * @param array $data in the API call * @@ -243,14 +243,14 @@ public function verifyTrustlySignedNotification($notification) { * @throws InvalidArgumentException If the public key for the API host * cannot be loaded. * - * @param string $host API host used for communication. Fully qualified + * @param ?string $host API host used for communication. Fully qualified * hostname. When integrating with our public API this is typically * either 'test.trustly.com' or 'trustly.com'. NULL means do not change. * - * @param integer $port Port on API host used for communicaiton. Normally + * @param ?integer $port Port on API host used for communicaiton. Normally * 443 for https, or 80 for http. NULL means do not change. * - * @param bool $is_https Indicator wether the port on the API host expects + * @param ?bool $is_https Indicator wether the port on the API host expects * https. NULL means do not change. */ public function setHost($host=NULL, $port=NULL, $is_https=NULL) { @@ -275,9 +275,9 @@ public function setHost($host=NULL, $port=NULL, $is_https=NULL) { /** * Setup and return a curl handle for submitting data to the API peer. * - * @param string $url The URL to communicate with + * @param ?string $url The URL to communicate with * - * @param string $postdata The (optional) data to post. + * @param ?string $postdata The (optional) data to post. * * @return Array($body, $response_code) */ @@ -392,7 +392,7 @@ public function baseURL() { /** * Return a URL to the API to the given request path. * - * @param Trustly_Data_Request $request Data to send in the request + * @param ?Trustly_Data_Request $request Data to send in the request * * @return URL to the API peer with the given query path. */ @@ -484,7 +484,7 @@ public function call($request) { /** * Return a boolean value formatted for communicating with the API. * - * @param boolean $value Boolean value to encode + * @param ?boolean $value Boolean value to encode * * @return API encoded boolean value */ @@ -506,7 +506,7 @@ protected function apiBool($value) { * * See specific class implementing the call for more information. * - * @param Trustly_Data_Request $request Data to send in the request + * @param ?Trustly_Data_Request $request Data to send in the request * * @return string The URL path */ diff --git a/Trustly/Api/signed.php b/Trustly/Api/signed.php index 69d0b5b..5166676 100644 --- a/Trustly/Api/signed.php +++ b/Trustly/Api/signed.php @@ -239,7 +239,7 @@ public function notificationResponse($request, $success=TRUE) { * * See specific class implementing the call for more information. * - * @param Trustly_Data_JSONRPCRequest $request Data to send in the request + * @param ?Trustly_Data_JSONRPCRequest $request Data to send in the request * * @return string The URL path */ @@ -980,70 +980,70 @@ public function accountPayout($notificationurl, $accountid, $enduserid, * * @param string $messageid Your unique ID for the deposit. * - * @param string $locale The end-users localization preference in the + * @param ?string $locale The end-users localization preference in the * format [language[_territory]]. Language is the ISO 639-1 code and * territory the ISO 3166-1-alpha-2 code. * - * @param float $amount with exactly two decimals in the currency specified + * @param ?float $amount with exactly two decimals in the currency specified * by Currency. Do not use this attribute in combination with * SuggestedMinAmount or SuggestedMaxAmount. Only digits. Use dot (.) * as decimal separator. * - * @param string $currency The currency of the end-user's account in the + * @param ?string $currency The currency of the end-user's account in the * merchant's system. * - * @param string $country The ISO 3166-1-alpha-2 code of the end-user's + * @param ?string $country The ISO 3166-1-alpha-2 code of the end-user's * country. This will be used for preselecting the correct country for * the end-user in the iframe. * - * @param string $mobilephone The mobile phonenumber to the end-user in + * @param ?string $mobilephone The mobile phonenumber to the end-user in * international format. This is used for KYC and AML routines. * - * @param string $firstname The end-user's firstname. Useful for some banks + * @param ?string $firstname The end-user's firstname. Useful for some banks * for identifying transactions. * - * @param string $lastname The end-user's lastname. Useful for some banks + * @param ?string $lastname The end-user's lastname. Useful for some banks * for identifying transactions. * - * @param string $nationalidentificationnumber The end-user's social + * @param ?string $nationalidentificationnumber The end-user's social * security number / personal number / birth number / etc. Useful for * some banks for identifying transactions and KYC/AML. * - * @param string $shopperstatement The text to show on the end-user's bank + * @param ?string $shopperstatement The text to show on the end-user's bank * statement. * - * @param string $ip The IP-address of the end-user. + * @param ?string $ip The IP-address of the end-user. * - * @param string $successurl The URL to which the end-user should be + * @param ?string $successurl The URL to which the end-user should be * redirected after a successful deposit. Do not put any logic on that * page since it's not guaranteed that the end-user will in fact visit * it. * - * @param string $failurl The URL to which the end-user should be + * @param ?string $failurl The URL to which the end-user should be * redirected after a failed deposit. Do not put any logic on that * page since it's not guaranteed that the end-user will in fact visit * it. * - * @param string $templateurl The URL to your template page for the + * @param ?string $templateurl The URL to your template page for the * checkout process. * - * @param string $urltarget The html target/framename of the SuccessURL. + * @param ?string $urltarget The html target/framename of the SuccessURL. * Only _top, _self and _parent are suported. * - * @param float $suggestedminamount The minimum amount the end-user is + * @param ?float $suggestedminamount The minimum amount the end-user is * allowed to deposit in the currency specified by Currency. Only * digits. Use dot (.) as decimal separator. * - * @param float $suggestedmaxamount The maximum amount the end-user is + * @param ?float $suggestedmaxamount The maximum amount the end-user is * allowed to deposit in the currency specified by Currency. Only * digits. Use dot (.) as decimal separator. * - * @param string $integrationmodule Version information for your + * @param ?string $integrationmodule Version information for your * integration module. This is for informational purposes only and can * be useful when troubleshooting problems. Should contain enough * version information to be useful. * - * @param boolean $holdnotifications Do not deliver notifications for this + * @param ?boolean $holdnotifications Do not deliver notifications for this * order. This is a parameter available when using test.trustly.com * and can be used for manually delivering notifications to your local * system during development. Intead you can get you notifications on @@ -1186,7 +1186,7 @@ public function void($orderid) { * @param string $currency The currency of the end-user's account in the * merchant's system. * - * @param string $shopperstatement The text to show on the end-user's bank + * @param ?string $shopperstatement The text to show on the end-user's bank * statement. * * @return Trustly_Data_JSONRPCSignedResponse diff --git a/Trustly/Api/unsigned.php b/Trustly/Api/unsigned.php index c62d6b9..fe2fd6e 100644 --- a/Trustly/Api/unsigned.php +++ b/Trustly/Api/unsigned.php @@ -87,7 +87,7 @@ public function __construct($username, $password, $host='trustly.com', $port=443 * * See specific class implementing the call for more information. * - * @param Trustly_Data_JSONRPCRequest $request Data to send in the request + * @param ?Trustly_Data_JSONRPCRequest $request Data to send in the request * * @return string The URL path */ @@ -181,11 +181,11 @@ public function newSessionCookie() { * * @param string $viewname Name of view * - * @param string $dateorder 'OLDER'|'NEVER' or NULL + * @param ?string $dateorder 'OLDER'|'NEVER' or NULL * - * @param string $datestamp Order used in relation with $dateorder + * @param ?string $datestamp Order used in relation with $dateorder * - * @param array $filterkeys Array of arrays of filters to apply to the data. + * @param ?array> $filterkeys Array of arrays of filters to apply to the data. * Arrays in the array consists of 1. Key name, 2. Key value, 3. * Operator, 4. Key value 2. Operator is one of 'NOT', 'BETWEEN' (in * which case Key value 2 must be set), 'LIKE', 'DECRYPTED', 'IN' @@ -195,11 +195,11 @@ public function newSessionCookie() { * * @param integer $offset Skip these many records in the start of the request * - * @param string $params Parameters for the view + * @param ?string $params Parameters for the view * - * @param string $sortby Column to sort by + * @param ?string $sortby Column to sort by * - * @param string $sortorder Sort order ASC or DESC + * @param ?string $sortorder Sort order ASC or DESC * * @return Trustly_Data_JSONRPCResponse Response from the API. * diff --git a/Trustly/Data/data.php b/Trustly/Data/data.php index a77274b..88121a8 100644 --- a/Trustly/Data/data.php +++ b/Trustly/Data/data.php @@ -83,7 +83,7 @@ public function vacuum($data) { * Get the specific data value from the payload or the full payload if * no value is supplied * - * @param string $name The optional data parameter to get. If NULL then the + * @param ?string $name The optional data parameter to get. If NULL then the * entire payload will be returned. * * @return mixed value diff --git a/Trustly/Data/jsonrpcnotificationrequest.php b/Trustly/Data/jsonrpcnotificationrequest.php index 6be3c5f..eef70d7 100644 --- a/Trustly/Data/jsonrpcnotificationrequest.php +++ b/Trustly/Data/jsonrpcnotificationrequest.php @@ -84,7 +84,7 @@ public function __construct($notification_body) { /** * Get value from or the entire params payload. * - * @param string $name Name of the params parameter to obtain. Leave blank + * @param ?string $name Name of the params parameter to obtain. Leave blank * to get the entire payload * * @return mixed The value for the params parameter or the entire payload @@ -110,7 +110,7 @@ public function getParams($name=NULL) { * Get the value of a parameter in the params->data section of the * notification response. * - * @param string $name The name of the parameter. Leave as NULL to get the + * @param ?string $name The name of the parameter. Leave as NULL to get the * entire payload. * * @return mixed The value sought after or the entire payload depending on diff --git a/Trustly/Data/jsonrpcnotificationresponse.php b/Trustly/Data/jsonrpcnotificationresponse.php index 87894a8..7e4b44b 100644 --- a/Trustly/Data/jsonrpcnotificationresponse.php +++ b/Trustly/Data/jsonrpcnotificationresponse.php @@ -42,7 +42,7 @@ class Trustly_Data_JSONRPCNotificationResponse extends Trustly_Data { * @param Trustly_Data_JSONRPCNotificationRequest $request Incoming * notification request to which we are responding * - * @param boolean $success Set to true to indicate that the notification + * @param ?boolean $success Set to true to indicate that the notification * was successfully processed. */ public function __construct($request, $success=NULL) { @@ -70,7 +70,7 @@ public function __construct($request, $success=NULL) { /** * Set the success status in the response. * - * @param boolean $success Set to true to indicate that the notification + * @param ?boolean $success Set to true to indicate that the notification * was successfully processed. * * @return $success @@ -120,7 +120,7 @@ public function setResult($name, $value) { * Get the value of a parameter in the result section of the notification * response. * - * @param string $name The name of the parameter. Leave as NULL to get the + * @param ?string $name The name of the parameter. Leave as NULL to get the * entire payload. * * @return mixed The value sought after or the entire payload depending on @@ -148,7 +148,7 @@ public function getResult($name=NULL) { * Get the value of a parameter in the result->data section of the * notification response. * - * @param string $name The name of the parameter. Leave as NULL to get the + * @param ?string $name The name of the parameter. Leave as NULL to get the * entire payload. * * @return mixed The value sought after or the entire payload depending on diff --git a/Trustly/Data/jsonrpcrequest.php b/Trustly/Data/jsonrpcrequest.php index 2b10f9a..7d28659 100644 --- a/Trustly/Data/jsonrpcrequest.php +++ b/Trustly/Data/jsonrpcrequest.php @@ -41,7 +41,7 @@ class Trustly_Data_JSONRPCRequest extends Trustly_Data_Request { * @throws Trustly_DataException If the combination of $data and * $attributes is invalid * - * @param string $method Outgoing call API method + * @param ?string $method Outgoing call API method * * @param mixed $data Outputgoing call Data (if any). This can be either an * array or a simple non-complex value. @@ -202,7 +202,7 @@ public function setData($name, $value) { * Get the value of one parameter in the params->Data section of the * request. Or the entire Data section if no name is given. * - * @param string $name Name of the Data param to obtain. Leave as NULL to + * @param ?string $name Name of the Data param to obtain. Leave as NULL to * get the entire structure. * * @return mixed The value or the entire Data depending on $name diff --git a/Trustly/Data/jsonrpcsignedresponse.php b/Trustly/Data/jsonrpcsignedresponse.php index 4b16b02..50883a0 100644 --- a/Trustly/Data/jsonrpcsignedresponse.php +++ b/Trustly/Data/jsonrpcsignedresponse.php @@ -88,7 +88,7 @@ public function __construct($response_body) { /** * Get data from the data section of the response * - * @param string $name Name of the data parameter to fetch. NULL value will + * @param ?string $name Name of the data parameter to fetch. NULL value will * return entire data section. * * @return mixed The value for parameter $name or the entire data block if diff --git a/Trustly/Data/request.php b/Trustly/Data/request.php index 3daaca7..f7538fe 100644 --- a/Trustly/Data/request.php +++ b/Trustly/Data/request.php @@ -43,9 +43,9 @@ class Trustly_Data_Request extends Trustly_Data { /** * Constructor. * - * @param string $method Method name for the call + * @param ?string $method Method name for the call * - * @param array $payload Call payload + * @param ?array $payload Call payload */ public function __construct($method=NULL, $payload=NULL) { parent::__construct(); diff --git a/Trustly/Data/response.php b/Trustly/Data/response.php index 0f4b97b..77754fa 100644 --- a/Trustly/Data/response.php +++ b/Trustly/Data/response.php @@ -64,7 +64,7 @@ class Trustly_Data_Response extends Trustly_Data { * * @param string $response_body RAW response body from the API call * - * @param integer $response_code HTTP response code from the API call + * @param ?integer $response_code HTTP response code from the API call */ public function __construct($response_body, $response_code=NULL) { parent::__construct(); @@ -165,7 +165,7 @@ public function getErrorCode() { /** * Get data from the result section of the response * - * @param string $name Name of the result parameter to fetch. NULL value + * @param ?string $name Name of the result parameter to fetch. NULL value * will return entire result section. * * @return mixed The value for parameter $name or the entire result block diff --git a/Trustly/exceptions.php b/Trustly/exceptions.php index e1a9724..8b1a642 100644 --- a/Trustly/exceptions.php +++ b/Trustly/exceptions.php @@ -53,7 +53,7 @@ class Trustly_SignatureException extends Exception { * * @param string $message Exception message * - * @param array $data Data that was signed with an invalid signature + * @param mixed $data Data that was signed with an invalid signature */ public function __construct($message, $data=NULL) { parent::__construct($message);