Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP 8.2 and Other Related Issues #640

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
76dc113
fix: Fatal error: Uncaught Error: Class "PhpCsFixer\Finder" not found
mralaminahamed Apr 30, 2024
591629c
added: required and optional properties
mralaminahamed Apr 30, 2024
b81fb0b
chore(composer): Updated to the latest version and config file also
mralaminahamed Apr 30, 2024
fad9d56
added: docker file for 8.1 and 8.2
mralaminahamed Apr 30, 2024
f4e69f4
fix: PHP Coding standards issues
mralaminahamed Apr 30, 2024
c6138da
removed: unused code
mralaminahamed Apr 30, 2024
d580082
add: missing property in Refund class
mralaminahamed Apr 30, 2024
959b1a7
added: missing property in PayIn
mralaminahamed Apr 30, 2024
475e87f
added: missing property in PayIn
mralaminahamed Apr 30, 2024
dd38b0f
Merge branch 'Mangopay:master' into fix/php-related-issues
mralaminahamed Apr 30, 2024
6da6e4f
Revert "fix: PHP Coding standards issues"
mralaminahamed Apr 30, 2024
6c17547
Update MangoPay/PayOut.php
mralaminahamed Apr 30, 2024
a096ea6
update: gitignore and attributes
mralaminahamed Apr 30, 2024
ba9a468
Merge branch 'fix/php-related-issues' of https://github.com/mralamina…
mralaminahamed Apr 30, 2024
96d67ae
added: label properties for KYC Document
mralaminahamed May 2, 2024
c1f8164
update: property doc for KYC $UserId
mralaminahamed May 2, 2024
ce7d988
update: api base, api ubo and its declaration for parameter type
mralaminahamed May 2, 2024
87bfb35
update: php cs fixer config
mralaminahamed May 2, 2024
c31570d
update: missing property for Ubo Declaration
mralaminahamed May 2, 2024
a12582a
Use local namespace for PayOutPaymentDetailsBankWire
mralaminahamed May 4, 2024
aa87640
Use local namespace for PayOutPaymentDetailsBankWire
mralaminahamed May 4, 2024
156a26d
Update Property documentation
mralaminahamed May 4, 2024
089bff7
Delete old install script
mralaminahamed May 4, 2024
964ee7e
delete: php cs fixer cache file
mralaminahamed May 4, 2024
596cca5
update: property documentation for KYC Documentation
mralaminahamed May 4, 2024
cfe79c5
update: Kyc Document class
mralaminahamed May 4, 2024
d77e72b
remove: shell path from docker composer
mralaminahamed May 6, 2024
85d3080
fix: php cs fixer issue at KYC Document property alignment
mralaminahamed May 6, 2024
27520ac
Merge remote-tracking branch 'upstream/master' into fix/php-related-i…
mralaminahamed May 30, 2024
d3f2448
Merge remote-tracking branch 'upstream/master' into fix/php-related-i…
mralaminahamed Jun 3, 2024
6dc14ea
rollback: `see` params for `$Type` in the `KycDocument`
mralaminahamed Jun 3, 2024
0149fb7
refactor: indentation is wrong in `PayOut.php`
mralaminahamed Jun 3, 2024
f205667
refactor: indentation is wrong in `PayOut.php`
mralaminahamed Jun 3, 2024
275dfda
refactor: Change the `@var` type to `object` because of there is many…
mralaminahamed Jun 3, 2024
87f0929
remove: `composer.sh` for php `8.1` and `8.2`
mralaminahamed Jun 3, 2024
ed80f9f
fix: line indents for `PayOut.php`
mralaminahamed Jun 3, 2024
6b9f10f
update: added docker config for `php 8.1` and `php 8.2` to `Makefile`
mralaminahamed Jun 3, 2024
f5303e0
update: added php versions for `php 8.1` and `php 8.2` to `build.yaml`
mralaminahamed Jun 3, 2024
3f3e135
refactor: property type for `PayOut.php`
mralaminahamed Jun 3, 2024
91ca58a
refactor: property type for `PayOut.php` (phpstan)
mralaminahamed Jun 3, 2024
586b770
refactor: property type for `PayOut.php` (phpstan)
mralaminahamed Jun 3, 2024
0268830
Merge branch 'master' into fix/php-related-issues
mralaminahamed Sep 23, 2024
beac573
Merge branch 'master' into fix/php-related-issues
mralaminahamed Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: PHP Coding standards issues
  • Loading branch information
mralaminahamed committed Apr 30, 2024
commit f4e69f4d7856e708d99c0440f1f5a8c9aafa0fa5
8 changes: 4 additions & 4 deletions MangoPay/ApiBankAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class ApiBankAccounts extends Libraries\ApiBase
/**
* Retrieves a list of Transactions pertaining to a certain Bank Account
* @param string $bankAccountId Bank Account identifier
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\FilterTransactions $filter Filtering object
* @param \MangoPay\Sorting $sorting Sorting object
* @throws \MangoPay\Libraries\Exception
* @param Pagination $pagination Pagination object
* @param FilterTransactions $filter Filtering object
* @param Sorting $sorting Sorting object
* @throws Libraries\Exception
mralaminahamed marked this conversation as resolved.
Show resolved Hide resolved
*/
public function GetTransactions($bankAccountId, & $pagination = null, $filter = null, $sorting = null)
{
Expand Down
18 changes: 9 additions & 9 deletions MangoPay/ApiBankingAliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApiBankingAliases extends Libraries\ApiBase
/**
* Get a banking alias
* @param string $bankingAliasId Banking alias identifier
* @return \MangoPay\BankingAlias returned from API
* @return BankingAlias returned from API
*/
public function Get($bankingAliasId)
{
Expand All @@ -20,8 +20,8 @@ public function Get($bankingAliasId)

/**
* Create a banking alias
* @param \MangoPay\BankingAlias $bankingAlias Banking alias
* @return \MangoPay\BankingAlias returned from API
* @param BankingAlias $bankingAlias Banking alias
* @return BankingAlias returned from API
* @throws Libraries\Exception
*/
public function Create($bankingAlias)
Expand All @@ -39,8 +39,8 @@ public function Create($bankingAlias)

/**
* Update banking alias
* @param \MangoPay\BankingAlias $bankingAlias Card object to save
* @return \MangoPay\BankingAlias Card object returned from API
* @param BankingAlias $bankingAlias Card object to save
* @return BankingAlias Card object returned from API
*/
public function Update($bankingAlias)
{
Expand All @@ -50,8 +50,8 @@ public function Update($bankingAlias)

/**
* Get all banking aliases
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\Sorting $sorting Object to sorting data
* @param Pagination $pagination Pagination object
* @param Sorting $sorting Object to sorting data
* @param string $walletId Wallet identifier
* @return \MangoPay\BankingAlias[] List of banking aliases
*/
Expand All @@ -64,8 +64,8 @@ public function GetAll($walletId, & $pagination = null, $sorting = null)
/**
* Get correct banking alias object
* @param object $response Response from API
* @return \MangoPay\BankingAlias BankingAlias object returned from API
* @throws \MangoPay\Libraries\Exception If occur unexpected response from API
* @return BankingAlias BankingAlias object returned from API
* @throws Libraries\Exception If occur unexpected response from API
*/
private function GetBankingAliasResponse($response)
{
Expand Down
10 changes: 5 additions & 5 deletions MangoPay/ApiCardPreAuthorizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class ApiCardPreAuthorizations extends Libraries\ApiBase
{
/**
* Create new pre-authorization object
* @param \MangoPay\CardPreAuthorization $cardPreAuthorization PreAuthorization object to create
* @return \MangoPay\CardPreAuthorization PreAuthorization object returned from API
* @param CardPreAuthorization $cardPreAuthorization PreAuthorization object to create
* @return CardPreAuthorization PreAuthorization object returned from API
*/
public function Create($cardPreAuthorization, $idempotencyKey = null)
{
Expand All @@ -20,7 +20,7 @@ public function Create($cardPreAuthorization, $idempotencyKey = null)
/**
* Get pre-authorization object
* @param string $cardPreAuthorizationId PreAuthorization identifier
* @return \MangoPay\CardPreAuthorization Card registration object returned from API
* @return CardPreAuthorization Card registration object returned from API
*/
public function Get($cardPreAuthorizationId)
{
Expand All @@ -29,8 +29,8 @@ public function Get($cardPreAuthorizationId)

/**
* Update pre-authorization object
* @param \MangoPay\CardPreAuthorization $cardPreAuthorization PreAuthorization object to save
* @return \MangoPay\CardPreAuthorization PreAuthorization object returned from API
* @param CardPreAuthorization $cardPreAuthorization PreAuthorization object to save
* @return CardPreAuthorization PreAuthorization object returned from API
*/
public function Update($cardPreAuthorization)
{
Expand Down
10 changes: 5 additions & 5 deletions MangoPay/ApiCardRegistrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class ApiCardRegistrations extends Libraries\ApiBase
{
/**
* Create new card registration
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to create
* @return \MangoPay\CardRegistration Card registration object returned from API
* @param CardRegistration $cardRegistration Card registration object to create
* @return CardRegistration Card registration object returned from API
*/
public function Create($cardRegistration, $idempotencyKey = null)
{
Expand All @@ -20,7 +20,7 @@ public function Create($cardRegistration, $idempotencyKey = null)
/**
* Get card registration
* @param string $cardRegistrationId Card Registration identifier
* @return \MangoPay\CardRegistration Card registration object returned from API
* @return CardRegistration Card registration object returned from API
*/
public function Get($cardRegistrationId)
{
Expand All @@ -29,8 +29,8 @@ public function Get($cardRegistrationId)

/**
* Update card registration
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to save
* @return \MangoPay\CardRegistration Card registration object returned from API
* @param CardRegistration $cardRegistration Card registration object to save
* @return CardRegistration Card registration object returned from API
*/
public function Update($cardRegistration)
{
Expand Down
26 changes: 13 additions & 13 deletions MangoPay/ApiCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApiCards extends Libraries\ApiBase
/**
* Get card
* @param string $cardId Card identifier
* @return \MangoPay\Card object returned from API
* @return Card object returned from API
*/
public function Get($cardId)
{
Expand All @@ -22,8 +22,8 @@ public function Get($cardId)
* The fingerprint is a hash uniquely generated per 16-digit card number.
*
* @param string $fingerprint The fingerprint hash
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\Sorting $sorting Sorting object
* @param Pagination $pagination Pagination object
* @param Sorting $sorting Sorting object
* @return \MangoPay\Card[] List of Cards corresponding to provided fingerprint
*/
public function GetByFingerprint($fingerprint, & $pagination = null, $sorting = null)
Expand All @@ -33,8 +33,8 @@ public function GetByFingerprint($fingerprint, & $pagination = null, $sorting =

/**
* Update card
* @param \MangoPay\Card $card Card object to save
* @return \MangoPay\Card Card object returned from API
* @param Card $card Card object to save
* @return Card Card object returned from API
*/
public function Update($card)
{
Expand All @@ -44,9 +44,9 @@ public function Update($card)
/**
* Gets a Card's PreAuthorizations
* @param int $cardId ID of the Card for which to retrieve PreAuthorizations
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\FilterPreAuthorizations filter Filtering object
* @param \MangoPay\Sorting $sorting Sorting object
* @param Pagination $pagination Pagination object
* @param FilterPreAuthorizations filter Filtering object
* @param Sorting $sorting Sorting object
* @return \MangoPay\CardPreAuthorization[] List of the Card's PreAuthorizations
*/
public function GetPreAuthorizations($cardId, $pagination = null, $filter = null, $sorting = null)
Expand All @@ -57,9 +57,9 @@ public function GetPreAuthorizations($cardId, $pagination = null, $filter = null
/**
* Retrieves a list of Transactions pertaining to a certain Card
* @param string $cardId Card identifier
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\FilterTransactions $filter Filtering object
* @param \MangoPay\Sorting $sorting Sorting object
* @param Pagination $pagination Pagination object
* @param FilterTransactions $filter Filtering object
* @param Sorting $sorting Sorting object
* @return \MangoPay\Transaction[]
*/
public function GetTransactions($cardId, & $pagination = null, $filter = null, $sorting = null)
Expand All @@ -70,7 +70,7 @@ public function GetTransactions($cardId, & $pagination = null, $filter = null, $
/**
* Validate a card
* @param $cardId
* @return \MangoPay\CardValidation
* @return CardValidation
* @throws Libraries\Exception
*/
public function ValidateCard($cardId, $cardValidation)
Expand All @@ -81,7 +81,7 @@ public function ValidateCard($cardId, $cardValidation)
/**
* Get card validation
* @param $cardId, $cardValidationId
* @return \MangoPay\Card
* @return Card
* @throws Libraries\Exception
*/
public function GetCardValidation($cardId, $cardValidationId)
Expand Down
50 changes: 25 additions & 25 deletions MangoPay/ApiClients.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApiClients extends Libraries\ApiBase
/**
* Get client information
*
* @return \MangoPay\Client Client object returned from API
* @return Client Client object returned from API
*/
public function Get()
{
Expand All @@ -20,7 +20,7 @@ public function Get()
/**
* Save client
* @param Client $client Client object to save
* @return \MangoPay\Client Client object returned from API
* @return Client Client object returned from API
*/
public function Update($client)
{
Expand All @@ -37,13 +37,13 @@ public function Update($client)
* Upload a logo for client.
* Only GIF, PNG, JPG, JPEG, BMP, PDF and DOC formats are accepted,
* and file must be less than about 7MB
* @param \MangoPay\ClientLogoUpload $logo ClientLogoUpload object
* @param ClientLogoUpload $logo ClientLogoUpload object
*/
public function UploadLogo($logoUpload, $idempotencyKey = null)
{
try {
$this->CreateObject('client_upload_logo', $logoUpload, null, null, null, $idempotencyKey);
} catch (\MangoPay\Libraries\ResponseException $exc) {
} catch (Libraries\ResponseException $exc) {
if ($exc->getCode() != 204) {
throw $exc;
}
Expand All @@ -55,7 +55,7 @@ public function UploadLogo($logoUpload, $idempotencyKey = null)
* Only GIF, PNG, JPG, JPEG, BMP, PDF and DOC formats are accepted,
* and file must be less than about 7MB
* @param string $file Path of file with logo
* @throws \MangoPay\Libraries\Exception
* @throws Libraries\Exception
*/
public function UploadLogoFromFile($file, $idempotencyKey = null)
{
Expand All @@ -65,18 +65,18 @@ public function UploadLogoFromFile($file, $idempotencyKey = null)
}

if (empty($filePath)) {
throw new \MangoPay\Libraries\Exception('Path of file cannot be empty');
throw new Libraries\Exception('Path of file cannot be empty');
}

if (!file_exists($filePath)) {
throw new \MangoPay\Libraries\Exception('File not exist');
throw new Libraries\Exception('File not exist');
}

$logoUpload = new \MangoPay\ClientLogoUpload();
$logoUpload = new ClientLogoUpload();
$logoUpload->File = base64_encode(file_get_contents($filePath));

if (empty($logoUpload->File)) {
throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
throw new Libraries\Exception('Content of the file cannot be empty');
}

$this->UploadLogo($logoUpload, $idempotencyKey);
Expand All @@ -86,14 +86,14 @@ public function UploadLogoFromFile($file, $idempotencyKey = null)
* View your client wallets. To see your fees or credit wallets
* for each currency set second $fundsType parameter.
*
* @param \MangoPay\FundsType $fundsType FundsType enum
* @param \MangoPay\Sorting $sorting Sorting object
* @param FundsType $fundsType FundsType enum
* @param Sorting $sorting Sorting object
*
* @return \MangoPay\Wallet[] List with your client wallets
*/
public function GetWallets($fundsType = null, $sorting = null)
{
$pagination = new \MangoPay\Pagination();
$pagination = new Pagination();

if (is_null($fundsType)) {
return $this->GetList('client_wallets', $pagination, '\MangoPay\Wallet', null, null, $sorting);
Expand All @@ -103,27 +103,27 @@ public function GetWallets($fundsType = null, $sorting = null)
return $this->GetList('client_wallets_credit', $pagination, '\MangoPay\Wallet', null, null, $sorting);
}

throw new \MangoPay\Libraries\Exception('\MangoPay\FundsType object has wrong value and cannot get wallets');
throw new Libraries\Exception('\MangoPay\FundsType object has wrong value and cannot get wallets');
}

/**
* View one of your client wallets (fees or credit) with a particular currency.
*
* @param \MangoPay\FundsType $fundsType FundsType enum
* @param \MangoPay\CurrencyIso $currencyIso CurrencyIso enum
* @param FundsType $fundsType FundsType enum
* @param CurrencyIso $currencyIso CurrencyIso enum
*
* @return \MangoPay\Wallet Wallet (fees or credit) with a particular currency
* @return Wallet Wallet (fees or credit) with a particular currency
*/
public function GetWallet($fundsType, $currencyIso)
{
if (is_null($fundsType)) {
throw new \MangoPay\Libraries\Exception(
throw new Libraries\Exception(
'First parameter in function GetWallet in class ApiClients is required.'
);
}

if (is_null($currencyIso)) {
throw new \MangoPay\Libraries\Exception(
throw new Libraries\Exception(
'Second parameter in function GetWallet in class ApiClients is required.'
);
}
Expand All @@ -134,7 +134,7 @@ public function GetWallet($fundsType, $currencyIso)
} elseif ($fundsType == FundsType::CREDIT) {
$methodKey = 'client_wallets_credit_currency';
} else {
throw new \MangoPay\Libraries\Exception('\MangoPay\FundsType object has wrong value and cannot get wallets');
throw new Libraries\Exception('\MangoPay\FundsType object has wrong value and cannot get wallets');
}

return $this->GetObject($methodKey, '\MangoPay\Wallet', $currencyIso);
Expand All @@ -143,10 +143,10 @@ public function GetWallet($fundsType, $currencyIso)
/**
* View the transactions linked to your client wallets (fees and credit)
*
* @param \MangoPay\FundsType $fundsType FundsType enum
* @param \MangoPay\CurrencyIso $currencyIso CurrencyIso enum
* @param \MangoPay\Pagination $pagination Pagination object
* @param \MangoPay\FilterTransactions $filter Object to filter data
* @param FundsType $fundsType FundsType enum
* @param CurrencyIso $currencyIso CurrencyIso enum
* @param Pagination $pagination Pagination object
* @param FilterTransactions $filter Object to filter data
*
* @return \MangoPay\Transaction[] Transactions linked to your client wallets (fees and credit)
*/
Expand All @@ -159,13 +159,13 @@ public function GetWalletTransactions($fundsType = null, $currencyIso = null, &
} elseif ($fundsType == FundsType::CREDIT) {
$methodKey = 'client_wallets_transactions_credit_currency';
} else {
throw new \MangoPay\Libraries\Exception(
throw new Libraries\Exception(
'\MangoPay\FundsType object has wrong value.'
);
}

if (!is_null($fundsType) && is_null($currencyIso)) {
throw new \MangoPay\Libraries\Exception(
throw new Libraries\Exception(
'If FundsType is defined the second parameter (currency) is required.'
);
}
Expand Down
6 changes: 3 additions & 3 deletions MangoPay/ApiConversions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ApiConversions extends Libraries\ApiBase
* The rate returned is given in real time.
* @param string $debitedCurrency The sell currency – the currency of the wallet to be debited
* @param string $creditedCurrency The buy currency – the currency of the wallet to be credited.
* @return \MangoPay\ConversionRate object returned from API
* @return ConversionRate object returned from API
*/
public function GetConversionRate($debitedCurrency, $creditedCurrency)
{
Expand All @@ -24,7 +24,7 @@ public function GetConversionRate($debitedCurrency, $creditedCurrency)
* This endpoint allows the platform to move funds between two
* wallets of different currencies instantaneously.
* @param CreateInstantConversion $instantConversion
* @return \MangoPay\Conversion object returned from API
* @return Conversion object returned from API
*/
public function CreateInstantConversion($instantConversion)
{
Expand All @@ -46,7 +46,7 @@ public function CreateQuotedConversion($quotedConversion)
* This endpoint allows the platform to get
* the details of a conversion which has been carried out.
* @param string $id The unique identifier of the conversion.
* @return \MangoPay\Conversion object returned from API
* @return Conversion object returned from API
*/
public function GetConversion($id)
{
Expand Down
Loading