From fb7ec70300582751e6c5caa451f502ccfebec5ab Mon Sep 17 00:00:00 2001 From: Manuel Mesquita Date: Mon, 14 Jul 2025 09:58:09 +0100 Subject: [PATCH] PRE-2923 - support5.6 to 8.4 php-version --- lib/Payplug/AccountingReport.php | 4 ++-- lib/Payplug/Authentication.php | 10 +++++----- lib/Payplug/Card.php | 2 +- lib/Payplug/Core/HttpClient.php | 2 +- lib/Payplug/InstallmentPlan.php | 6 +++--- lib/Payplug/OneySimulation.php | 2 +- lib/Payplug/Payment.php | 10 +++++----- lib/Payplug/PluginTelemetry.php | 2 +- lib/Payplug/Refund.php | 6 +++--- lib/Payplug/Resource/AccountingReport.php | 6 +++--- lib/Payplug/Resource/Card.php | 4 ++-- .../Resource/IVerifiableAPIResource.php | 2 +- lib/Payplug/Resource/InstallmentPlan.php | 10 +++++----- .../Resource/OneySimulationResource.php | 2 +- lib/Payplug/Resource/Payment.php | 18 +++++++++--------- lib/Payplug/Resource/Refund.php | 8 ++++---- 16 files changed, 47 insertions(+), 47 deletions(-) diff --git a/lib/Payplug/AccountingReport.php b/lib/Payplug/AccountingReport.php index 45eef3a..076415e 100644 --- a/lib/Payplug/AccountingReport.php +++ b/lib/Payplug/AccountingReport.php @@ -16,7 +16,7 @@ class AccountingReport * * @throws Exception\ConfigurationNotSetException */ - public static function retrieve($reportId, Payplug $payplug = null) + public static function retrieve($reportId, $payplug = null) { return Resource\AccountingReport::retrieve($reportId, $payplug); } @@ -31,7 +31,7 @@ public static function retrieve($reportId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug $payplug = null) + public static function create(array $data, $payplug = null) { return Resource\AccountingReport::create($data, $payplug); } diff --git a/lib/Payplug/Authentication.php b/lib/Payplug/Authentication.php index 54059e8..8e45b80 100644 --- a/lib/Payplug/Authentication.php +++ b/lib/Payplug/Authentication.php @@ -43,7 +43,7 @@ public static function getKeysByLogin($email, $password) * @throws Exception\ConfigurationNotSetException * @throws ConfigurationException */ - public static function getAccount(Payplug $payplug = null) + public static function getAccount($payplug = null) { if ($payplug === null) { $payplug = Payplug::getDefaultConfiguration(); @@ -66,7 +66,7 @@ public static function getAccount(Payplug $payplug = null) * @throws Exception\ConfigurationNotSetException * @throws ConfigurationException */ - public static function getPermissions(Payplug $payplug = null) + public static function getPermissions($payplug = null) { if ($payplug === null) { $payplug = Payplug::getDefaultConfiguration(); @@ -117,7 +117,7 @@ public static function getPermissionsByLogin($email, $password) *createClientIdAndSecret * @throws Exception */ - public static function getPublishableKeys(Payplug $payplug = null) + public static function getPublishableKeys($payplug = null) { if ($payplug === null) { $payplug = Payplug::getDefaultConfiguration(); @@ -238,7 +238,7 @@ public static function generateJWTOneShot($authorization_code='', $callback_uri= * @return void * @throws ConfigurationException */ - private static function validateToken(Payplug $payplug) + private static function validateToken($payplug) { $token = $payplug->getToken(); if (empty($token)) { @@ -262,7 +262,7 @@ private static function validateToken(Payplug $payplug) * @throws Exception\HttpException * @throws Exception\UnexpectedAPIResponseException */ - public static function createClientIdAndSecret($company_id = '', $client_name = '', $mode = '', $session = null, Payplug $payplug = null) + public static function createClientIdAndSecret($company_id = '', $client_name = '', $mode = '', $session = null, $payplug = null) { if ($payplug === null) { $payplug = Payplug::getDefaultConfiguration(); diff --git a/lib/Payplug/Card.php b/lib/Payplug/Card.php index d2e7ed3..7fb1291 100644 --- a/lib/Payplug/Card.php +++ b/lib/Payplug/Card.php @@ -16,7 +16,7 @@ class Card * * @throws Exception\ConfigurationNotSetException */ - public static function delete($card, Payplug $payplug = null) + public static function delete($card, $payplug = null) { return Resource\Card::deleteCard($card, $payplug); } diff --git a/lib/Payplug/Core/HttpClient.php b/lib/Payplug/Core/HttpClient.php index 74e4f86..ec4cadc 100644 --- a/lib/Payplug/Core/HttpClient.php +++ b/lib/Payplug/Core/HttpClient.php @@ -39,7 +39,7 @@ class HttpClient * * @param Payplug\Payplug $authentication the client configuration */ - public function __construct(Payplug\Payplug $authentication = null) + public function __construct($authentication = null) { $this->_configuration = $authentication; } diff --git a/lib/Payplug/InstallmentPlan.php b/lib/Payplug/InstallmentPlan.php index 1260034..31cbaff 100644 --- a/lib/Payplug/InstallmentPlan.php +++ b/lib/Payplug/InstallmentPlan.php @@ -16,7 +16,7 @@ class InstallmentPlan * * @throws Exception\ConfigurationNotSetException */ - public static function retrieve($installmentPlanId, Payplug $payplug = null) + public static function retrieve($installmentPlanId, $payplug = null) { return Resource\InstallmentPlan::retrieve($installmentPlanId, $payplug); } @@ -31,7 +31,7 @@ public static function retrieve($installmentPlanId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function abort($installmentPlanId, Payplug $payplug = null) + public static function abort($installmentPlanId, $payplug = null) { $installmentPlan = Resource\InstallmentPlan::fromAttributes(array('id' => $installmentPlanId)); return $installmentPlan->abort($payplug); @@ -47,7 +47,7 @@ public static function abort($installmentPlanId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug $payplug = null) + public static function create(array $data, $payplug = null) { return Resource\InstallmentPlan::create($data, $payplug); } diff --git a/lib/Payplug/OneySimulation.php b/lib/Payplug/OneySimulation.php index 14af811..6f73063 100755 --- a/lib/Payplug/OneySimulation.php +++ b/lib/Payplug/OneySimulation.php @@ -16,7 +16,7 @@ class OneySimulation { * @throws Exception\HttpException * @throws Exception\UnexpectedAPIResponseException */ - public static function getSimulations($data, Payplug $payplug = null) + public static function getSimulations($data, $payplug = null) { return Resource\OneySimulationResource::getSimulations($data, $payplug); } diff --git a/lib/Payplug/Payment.php b/lib/Payplug/Payment.php index 3abcb1e..c4668c9 100644 --- a/lib/Payplug/Payment.php +++ b/lib/Payplug/Payment.php @@ -16,7 +16,7 @@ class Payment * * @throws Exception\ConfigurationNotSetException */ - public static function retrieve($paymentId, Payplug $payplug = null) + public static function retrieve($paymentId, $payplug = null) { return Resource\Payment::retrieve($paymentId, $payplug); } @@ -31,7 +31,7 @@ public static function retrieve($paymentId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function abort($paymentId, Payplug $payplug = null) + public static function abort($paymentId, $payplug = null) { $payment = Resource\Payment::fromAttributes(array('id' => $paymentId)); return $payment->abort($payplug); @@ -47,7 +47,7 @@ public static function abort($paymentId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function capture($paymentId, Payplug $payplug = null) + public static function capture($paymentId, $payplug = null) { $payment = Resource\Payment::fromAttributes(array('id' => $paymentId)); return $payment->capture($payplug); @@ -63,7 +63,7 @@ public static function capture($paymentId, Payplug $payplug = null) * * @throws Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug $payplug = null) + public static function create(array $data, $payplug = null) { return Resource\Payment::create($data, $payplug); } @@ -80,7 +80,7 @@ public static function create(array $data, Payplug $payplug = null) * @throws Exception\InvalidPaymentException * @throws Exception\UnexpectedAPIResponseException */ - public static function listPayments($perPage = null, $page = null, Payplug $payplug = null) + public static function listPayments($perPage = null, $page = null, $payplug = null) { return Resource\Payment::listPayments($perPage, $page, $payplug); } diff --git a/lib/Payplug/PluginTelemetry.php b/lib/Payplug/PluginTelemetry.php index be53466..bc7a14c 100644 --- a/lib/Payplug/PluginTelemetry.php +++ b/lib/Payplug/PluginTelemetry.php @@ -20,7 +20,7 @@ class PluginTelemetry * @throws Exception\HttpException * @throws Exception\UnexpectedAPIResponseException */ - public static function send($data = '{}', Payplug $payplug = null) + public static function send($data = '{}', $payplug = null) { $data = json_decode($data, true); diff --git a/lib/Payplug/Refund.php b/lib/Payplug/Refund.php index f5049f8..4542345 100644 --- a/lib/Payplug/Refund.php +++ b/lib/Payplug/Refund.php @@ -15,7 +15,7 @@ class Refund { * @return null|Refund the refund object * @throws Exception\ConfigurationNotSetException */ - public static function create($payment, array $data = null, Payplug $payplug = null) + public static function create($payment, array $data = null, $payplug = null) { return Resource\Refund::create($payment, $data, $payplug); } @@ -31,7 +31,7 @@ public static function create($payment, array $data = null, Payplug $payplug = n * * @throws Exception\ConfigurationNotSetException */ - public static function retrieve($payment, $refundId, Payplug $payplug = null) + public static function retrieve($payment, $refundId, $payplug = null) { return Resource\Refund::retrieve($payment, $refundId, $payplug); } @@ -47,7 +47,7 @@ public static function retrieve($payment, $refundId, Payplug $payplug = null) * @throws Exception\ConfigurationNotSetException * @throws Exception\UnexpectedAPIResponseException */ - public static function listRefunds($payment, Payplug $payplug = null) + public static function listRefunds($payment, $payplug = null) { return Resource\Refund::listRefunds($payment, $payplug); } diff --git a/lib/Payplug/Resource/AccountingReport.php b/lib/Payplug/Resource/AccountingReport.php index d264d8e..dc514e2 100644 --- a/lib/Payplug/Resource/AccountingReport.php +++ b/lib/Payplug/Resource/AccountingReport.php @@ -31,7 +31,7 @@ public static function fromAttributes(array $attributes) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function retrieve($reportId, Payplug\Payplug $payplug = null) + public static function retrieve($reportId, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -55,7 +55,7 @@ public static function retrieve($reportId, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug\Payplug $payplug = null) + public static function create(array $data, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -79,7 +79,7 @@ public static function create(array $data, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\UndefinedAttributeException when the local resource is invalid. */ - function getConsistentResource(Payplug\Payplug $payplug = null) + function getConsistentResource($payplug = null) { if (!array_key_exists('id', $this->_attributes)) { throw new Payplug\Exception\UndefinedAttributeException('The id of the accounting report is not set.'); diff --git a/lib/Payplug/Resource/Card.php b/lib/Payplug/Resource/Card.php index cbbe511..7b27cf3 100644 --- a/lib/Payplug/Resource/Card.php +++ b/lib/Payplug/Resource/Card.php @@ -31,7 +31,7 @@ public static function fromAttributes(array $attributes) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function deleteCard($card, Payplug\Payplug $payplug = null) + public static function deleteCard($card, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -54,7 +54,7 @@ public static function deleteCard($card, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public function delete(Payplug\Payplug $payplug = null) + public function delete($payplug = null) { self::deleteCard($this->id, $payplug); } diff --git a/lib/Payplug/Resource/IVerifiableAPIResource.php b/lib/Payplug/Resource/IVerifiableAPIResource.php index 69767ec..4d49bcb 100644 --- a/lib/Payplug/Resource/IVerifiableAPIResource.php +++ b/lib/Payplug/Resource/IVerifiableAPIResource.php @@ -18,5 +18,5 @@ interface IVerifiableAPIResource * * @throws Payplug\Exception\UndefinedAttributeException when the local resource is invalid. */ - function getConsistentResource(Payplug\Payplug $payplug = null); + function getConsistentResource($payplug = null); } diff --git a/lib/Payplug/Resource/InstallmentPlan.php b/lib/Payplug/Resource/InstallmentPlan.php index 2d405c7..a914247 100644 --- a/lib/Payplug/Resource/InstallmentPlan.php +++ b/lib/Payplug/Resource/InstallmentPlan.php @@ -71,7 +71,7 @@ protected function initialize(array $attributes) * @throws Payplug\Exception\UndefinedAttributeException * @throws Payplug\Exception\UnexpectedAPIResponseException */ - public function listPayments(Payplug\Payplug $payplug = null) + public function listPayments($payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -106,7 +106,7 @@ public function listPayments(Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public function abort(Payplug\Payplug $payplug = null) + public function abort($payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -131,7 +131,7 @@ public function abort(Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function retrieve($installmentPlanId, Payplug\Payplug $payplug = null) + public static function retrieve($installmentPlanId, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -156,7 +156,7 @@ public static function retrieve($installmentPlanId, Payplug\Payplug $payplug = n * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug\Payplug $payplug = null) + public static function create(array $data, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -180,7 +180,7 @@ public static function create(array $data, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\UndefinedAttributeException when the local resource is invalid. */ - function getConsistentResource(Payplug\Payplug $payplug = null) + function getConsistentResource($payplug = null) { if (!array_key_exists('id', $this->_attributes)) { throw new Payplug\Exception\UndefinedAttributeException( diff --git a/lib/Payplug/Resource/OneySimulationResource.php b/lib/Payplug/Resource/OneySimulationResource.php index ca9f9d4..4585e70 100644 --- a/lib/Payplug/Resource/OneySimulationResource.php +++ b/lib/Payplug/Resource/OneySimulationResource.php @@ -58,7 +58,7 @@ protected function initialize(array $attributes) * @throws Payplug\Exception\HttpException * @throws Payplug\Exception\UnexpectedAPIResponseException */ - public static function getSimulations($sim_data, Payplug\Payplug $payplug = null) + public static function getSimulations($sim_data, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); diff --git a/lib/Payplug/Resource/Payment.php b/lib/Payplug/Resource/Payment.php index 1be36c9..aeca95a 100644 --- a/lib/Payplug/Resource/Payment.php +++ b/lib/Payplug/Resource/Payment.php @@ -71,7 +71,7 @@ protected function initialize(array $attributes) * * @throws Payplug\Exception\InvalidPaymentException when the id of the payment is invalid */ - public function refund(array $data = null, Payplug\Payplug $payplug = null) + public function refund(array $data = null, $payplug = null) { if (!array_key_exists('id', $this->getAttributes())) { throw new Payplug\Exception\InvalidPaymentException("This payment object has no id. It can't be refunded."); @@ -90,7 +90,7 @@ public function refund(array $data = null, Payplug\Payplug $payplug = null) * @throws Payplug\Exception\InvalidPaymentException * @throws Payplug\Exception\UnexpectedAPIResponseException */ - public function listRefunds(Payplug\Payplug $payplug = null) + public function listRefunds($payplug = null) { if (!array_key_exists('id', $this->getAttributes())) { throw new Payplug\Exception\InvalidPaymentException("This payment object has no id. You can't list refunds on it."); @@ -108,7 +108,7 @@ public function listRefunds(Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public function abort(Payplug\Payplug $payplug = null) + public function abort($payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -132,7 +132,7 @@ public function abort(Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public function capture(Payplug\Payplug $payplug = null) + public function capture($payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -159,7 +159,7 @@ public function capture(Payplug\Payplug $payplug = null) * @throws Payplug\Exception\UndefinedAttributeException * @throws Payplug\Exception\NotFoundException */ - public static function retrieve($paymentId, Payplug\Payplug $payplug = null) + public static function retrieve($paymentId, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -189,7 +189,7 @@ public static function retrieve($paymentId, Payplug\Payplug $payplug = null) * @throws Payplug\Exception\InvalidPaymentException * @throws Payplug\Exception\UnexpectedAPIResponseException */ - public static function listPayments($perPage = null, $page = null, Payplug\Payplug $payplug = null) + public static function listPayments($perPage = null, $page = null, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -227,7 +227,7 @@ public static function listPayments($perPage = null, $page = null, Payplug\Paypl * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function create(array $data, Payplug\Payplug $payplug = null) + public static function create(array $data, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -252,7 +252,7 @@ public static function create(array $data, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\ConfigurationNotSetException */ - public function update(array $data, Payplug\Payplug $payplug = null) + public function update(array $data, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -276,7 +276,7 @@ public function update(array $data, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\UndefinedAttributeException when the local resource is invalid. */ - function getConsistentResource(Payplug\Payplug $payplug = null) + function getConsistentResource($payplug = null) { if (!array_key_exists('id', $this->_attributes)) { throw new Payplug\Exception\UndefinedAttributeException('The id of the payment is not set.'); diff --git a/lib/Payplug/Resource/Refund.php b/lib/Payplug/Resource/Refund.php index 70c6a73..72d4771 100644 --- a/lib/Payplug/Resource/Refund.php +++ b/lib/Payplug/Resource/Refund.php @@ -31,7 +31,7 @@ public static function fromAttributes(array $attributes) * @return null|Refund the refund object * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function create($payment, array $data = null, Payplug\Payplug $payplug = null) + public static function create($payment, array $data = null, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -60,7 +60,7 @@ public static function create($payment, array $data = null, Payplug\Payplug $pay * * @throws Payplug\Exception\ConfigurationNotSetException */ - public static function retrieve($payment, $refundId, Payplug\Payplug $payplug = null) + public static function retrieve($payment, $refundId, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -90,7 +90,7 @@ public static function retrieve($payment, $refundId, Payplug\Payplug $payplug = * @throws Payplug\Exception\ConfigurationNotSetException * @throws Payplug\Exception\UnexpectedAPIResponseException */ - public static function listRefunds($payment, Payplug\Payplug $payplug = null) + public static function listRefunds($payment, $payplug = null) { if ($payplug === null) { $payplug = Payplug\Payplug::getDefaultConfiguration(); @@ -129,7 +129,7 @@ public static function listRefunds($payment, Payplug\Payplug $payplug = null) * * @throws Payplug\Exception\UndefinedAttributeException when the local resource is invalid. */ - function getConsistentResource(Payplug\Payplug $payplug = null) + function getConsistentResource($payplug = null) { if (!array_key_exists('id', $this->_attributes)) { throw new Payplug\Exception\UndefinedAttributeException('The id of the refund is not set.');