Skip to content

Commit 9c7ddee

Browse files
committed
Improve the php-cs-fixer configuration
1 parent 0647b69 commit 9c7ddee

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

.cache/generate/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

.cache/php-cs-fixer/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/vendor/
22
/composer.lock
33
/phpunit.xml
4-
*.cache
4+
/.phpunit.result.cache

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
'ordered_class_elements' => ['sort_algorithm' => 'none'],
8484
'class_attributes_separation' => ['elements' => ['property' => 'one', 'method' => 'one']],
8585
'array_indentation' => true,
86+
'ternary_to_null_coalescing' => true,
8687
])
8788
->setFinder($finder)
8889
;

src/ValueObject/CardInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class CardInfo
2525
public function __construct(array $input)
2626
{
2727
$this->value = isset($input['value']) ? MoneyAmount::create($input['value']) : $this->throwException(new InvalidArgument('Missing required field "value".'));
28-
$this->cardStatus = isset($input['cardStatus']) ? $input['cardStatus'] : $this->throwException(new InvalidArgument('Missing required field "cardStatus".'));
28+
$this->cardStatus = $input['cardStatus'] ?? $this->throwException(new InvalidArgument('Missing required field "cardStatus".'));
2929
}
3030

3131
/**

src/ValueObject/MoneyAmount.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ final class MoneyAmount
2525
*/
2626
public function __construct(array $input)
2727
{
28-
$this->amount = isset($input['amount']) ? $input['amount'] : $this->throwException(new InvalidArgument('Missing required field "amount".'));
29-
$this->currencyCode = isset($input['currencyCode']) ? $input['currencyCode'] : $this->throwException(new InvalidArgument('Missing required field "currencyCode".'));
28+
$this->amount = $input['amount'] ?? $this->throwException(new InvalidArgument('Missing required field "amount".'));
29+
$this->currencyCode = $input['currencyCode'] ?? $this->throwException(new InvalidArgument('Missing required field "currencyCode".'));
3030
}
3131

3232
/**

tests/Integration/AmazonIncentivesClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testGetAvailableFunds(): void
115115

116116
private function getClient(): AmazonIncentivesClient
117117
{
118-
if (!isset($_SERVER['AMAZON_INCENTIVES_ACCESS_KEY'], $_SERVER['AMAZON_INCENTIVES_SECRET_KEY']) || $_SERVER['AMAZON_INCENTIVES_ACCESS_KEY'] === '' || $_SERVER['AMAZON_INCENTIVES_SECRET_KEY'] === '') {
118+
if (!isset($_SERVER['AMAZON_INCENTIVES_ACCESS_KEY'], $_SERVER['AMAZON_INCENTIVES_SECRET_KEY']) || '' === $_SERVER['AMAZON_INCENTIVES_ACCESS_KEY'] || '' === $_SERVER['AMAZON_INCENTIVES_SECRET_KEY']) {
119119
self::markTestSkipped('Test credentials are not provided.');
120120
}
121121

@@ -126,7 +126,7 @@ private function getClient(): AmazonIncentivesClient
126126

127127
private function getPartnerId(): string
128128
{
129-
if (!isset($_SERVER['AMAZON_INCENTIVES_PARTNER_ID']) || $_SERVER['AMAZON_INCENTIVES_PARTNER_ID'] === '') {
129+
if (!isset($_SERVER['AMAZON_INCENTIVES_PARTNER_ID']) || '' === $_SERVER['AMAZON_INCENTIVES_PARTNER_ID']) {
130130
self::markTestSkipped('Test credentials are not provided.');
131131
}
132132

0 commit comments

Comments
 (0)