Skip to content

Commit

Permalink
Introduce EditorConfig (#550)
Browse files Browse the repository at this point in the history
* Introduce EditorConfig

* Fix EC

---------

Co-authored-by: Alexandros Moraitis <[email protected]>
  • Loading branch information
szepeviktor and AlexandrosMor authored Aug 25, 2023
1 parent e46dc36 commit f4ade8e
Show file tree
Hide file tree
Showing 27 changed files with 142 additions and 116 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 165
eclint_block_comment_start = /*
eclint_block_comment = *
eclint_block_comment_end = */

[Makefile]
indent_style = tab
max_line_length = unset

[{*.xml,*.yml,*.yaml}]
indent_size = 2

[{*.json,*.md,*.mustache}]
indent_size = 2
max_line_length = unset
insert_final_newline = unset
4 changes: 2 additions & 2 deletions .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: make models
- name: Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
Expand All @@ -36,4 +36,4 @@ jobs:
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
add-paths: |
src/Adyen/Model
src/Adyen/Model
4 changes: 2 additions & 2 deletions .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: make all
- name: Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
Expand Down Expand Up @@ -37,4 +37,4 @@ jobs:
body: ${{ steps.vars.outputs.pr_body }}
add-paths: |
src/Adyen/Model
src/Adyen/Service
src/Adyen/Service
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ composer.lock
.phpunit.result.cache

# Automation
/target/
/target/
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ include:
Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting

## Our Responsibilities

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $client = new \Adyen\Client();
$client->setXApiKey("YOUR API KEY");
$client->setEnvironment(\Adyen\Environment::LIVE, 'Your live URL prefix');
$client->setTimeout(30);

...
~~~~

Expand Down
2 changes: 1 addition & 1 deletion bin/composer-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
exit $RESULT
8 changes: 5 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
~
-->

<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>build/*</exclude-pattern>

Expand All @@ -20,4 +22,4 @@
<arg value="p"/>

<rule ref="PSR2"/>
</ruleset>
</ruleset>
2 changes: 1 addition & 1 deletion src/Adyen/Util/IpAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getAdyenIpAddresses()
$ipAddresses = array();
foreach (self::$HOSTNAMES as $hostname) {
$ipAddressesOfHostName = gethostbynamel($hostname);

// gethostbynamel can return false if hostname could not be resolved
if (false !== $ipAddressesOfHostName) {
$ipAddresses = array_merge($ipAddresses, $ipAddressesOfHostName);
Expand Down
2 changes: 1 addition & 1 deletion templates/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class ObjectSerializer
// determine file name
if (
is_array($httpHeaders)
&& array_key_exists('Content-Disposition', $httpHeaders)
&& array_key_exists('Content-Disposition', $httpHeaders)
&& preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)
) {
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
Expand Down
2 changes: 1 addition & 1 deletion templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ files:
api-single.mustache:
folder: api
templateType: API
destinationFilename: Single.php
destinationFilename: Single.php
4 changes: 2 additions & 2 deletions templates/model_generic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
*/
protected static $openAPINullables = [
{{#vars}}'{{name}}' => {{#isNullable}}true{{/isNullable}}{{^isNullable}}{{^isInteger}}false{{/isInteger}}{{/isNullable}}{{^isNullable}}{{#isInteger}}true{{/isInteger}}{{/isNullable}}{{^-last}},
{{/-last}}{{/vars}}
{{/-last}}{{/vars}}
];

/**
Expand Down Expand Up @@ -465,7 +465,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return ObjectSerializer::sanitizeForSerialization($this);
return ObjectSerializer::sanitizeForSerialization($this);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Resources/Checkout/cardDetails-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"supported" : true
}
]
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Checkout/payment-links-expired.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"expiresAt": "2020-06-30T08:23:18Z",
"reference": "YOUR_ORDER_NUMBER",
"url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59"
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Checkout/payment-links-invalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"errorCode": "130",
"message": "Reference Missing",
"errorType": "validation"
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Checkout/payment-links-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"expiresAt": "2020-06-30T08:23:18Z",
"reference": "YOUR_ORDER_NUMBER",
"url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59"
}
}
36 changes: 18 additions & 18 deletions tests/Resources/Checkout/payments-success-3D.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"resultCode": "RedirectShopper",
"details": [{
"key": "MD",
"type": "text"
}, {
"key": "PaRes",
"type": "text"
}],
"paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...",
"redirect": {
"data": {
"PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...",
"TermUrl": "https:\/\/your-company.com\/...",
"MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..."
},
"method": "POST",
"url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml"
}
"resultCode": "RedirectShopper",
"details": [{
"key": "MD",
"type": "text"
}, {
"key": "PaRes",
"type": "text"
}],
"paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...",
"redirect": {
"data": {
"PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...",
"TermUrl": "https:\/\/your-company.com\/...",
"MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..."
},
"method": "POST",
"url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml"
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Checkout/sessions-invalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"errorCode": "702",
"message": "Required field 'amount' is null",
"errorType": "validation"
}
}
36 changes: 18 additions & 18 deletions tests/Resources/ModelBasedCheckout/payments-success-3D.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"resultCode": "RedirectShopper",
"details": [{
"key": "MD",
"type": "text"
}, {
"key": "PaRes",
"type": "text"
}],
"paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...",
"redirect": {
"data": {
"PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...",
"TermUrl": "https:\/\/your-company.com\/...",
"MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..."
},
"method": "POST",
"url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml"
}
"resultCode": "RedirectShopper",
"details": [{
"key": "MD",
"type": "text"
}, {
"key": "PaRes",
"type": "text"
}],
"paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...",
"redirect": {
"data": {
"PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...",
"TermUrl": "https:\/\/your-company.com\/...",
"MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..."
},
"method": "POST",
"url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml"
}
}
2 changes: 1 addition & 1 deletion tests/Resources/StoredValue/void-transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"refusalReason": "string",
"resultCode": "NotEnoughBalance",
"thirdPartyRefusalReason": "string"
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Tranfers/all-transactions-get.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
"href": "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ"
}
}
}
}
2 changes: 1 addition & 1 deletion tests/Resources/Tranfers/transfer-funds.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"direction": "outgoing",
"reason": "approved",
"status": "authorised"
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ protected function needSkinCode()
$this->skipTest("Skipped the test. Configure your SkinCode in the config");
}
}

public function validateApiPermission($e)
{
// it is possible you do not have permission to use full API then switch over to CSE
Expand Down
26 changes: 13 additions & 13 deletions tests/Unit/ModificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ public function testRefundWithDataSuccess($jsonFile, $httpStatus)

$params = json_decode(
'
{
"amount":{
"value":1500,
"currency":"GBP"
},
"selectedRecurringDetailReference":"8315535507322518",
"shopperReference":"myshopperreference",
"reference":"myreference",
"merchantAccount":"mymerchantaccount",
"recurring":{
"contract":"RECURRING"
},
"shopperInteraction":"ContAuth"
{
"amount": {
"value":1500,
"currency":"GBP"
},
"selectedRecurringDetailReference":"8315535507322518",
"shopperReference":"myshopperreference",
"reference":"myreference",
"merchantAccount":"mymerchantaccount",
"recurring":{
"contract":"RECURRING"
},
"shopperInteraction":"ContAuth"
}',
true
);
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public function testNotificationGetlistSuccess($jsonFile, $httpStatus)
'
{
"configurationDetails": {
}
}',
true
Expand Down
18 changes: 9 additions & 9 deletions tests/Unit/RecurringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function testNotifyShopperSuccess($jsonFile, $httpStatus)
$params = json_decode(
'{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"storedPaymentMethodId": "8415995487234100",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"amount": {
"currency": "INR",
"value": 1000
},
"billingDate": "2021-03-16",
"reference": "Example reference",
"displayedReference": "Example displayed reference"
"storedPaymentMethodId": "8415995487234100",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"amount": {
"currency": "INR",
"value": 1000
},
"billingDate": "2021-03-16",
"reference": "Example reference",
"displayedReference": "Example displayed reference"
}',
true
);
Expand Down
Loading

0 comments on commit f4ade8e

Please sign in to comment.