Skip to content

Commit 3d7ce94

Browse files
committed
Fix coding style
1 parent 607f855 commit 3d7ce94

File tree

10 files changed

+34
-27
lines changed

10 files changed

+34
-27
lines changed

Diff for: .php_cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
66
;
77

88
return Symfony\CS\Config\Config::create()
9-
->fixers(array('-phpdoc_short_description', '-empty_return', '-pre_increment', 'ordered_use'))
9+
->fixers(array('-phpdoc_short_description', '-empty_return', '-pre_increment', '-unneeded_control_parentheses', 'ordered_use'))
1010
->finder($finder)
1111
;

Diff for: src/Z38/SwissPayment/TransactionInformation/BankCreditTransfer.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Z38\SwissPayment\TransactionInformation;
44

55
use DOMDocument;
6+
use InvalidArgumentException;
67
use Z38\SwissPayment\BC;
78
use Z38\SwissPayment\BIC;
89
use Z38\SwissPayment\FinancialInstitutionInterface;
@@ -32,25 +33,23 @@ class BankCreditTransfer extends CreditTransfer
3233
* @param IBAN $creditorIBAN IBAN of the creditor
3334
* @param BC|BIC $creditorAgent BC or BIC of the creditor's financial institution
3435
*
35-
* @throws \InvalidArgumentException.
36-
* An InvalidArgumentException is thrown if amount is not EUR or CHF
37-
* or if creditorAgent is not BC or BIC
36+
* @throws \InvalidArgumentException When the amount is not in EUR or CHF or when the creditor agent is not BC or BIC.
3837
*/
3938
public function __construct($instructionId, $endToEndId, Money\Money $amount, $creditorName, PostalAddressInterface $creditorAddress, IBAN $creditorIBAN, FinancialInstitutionInterface $creditorAgent)
4039
{
41-
if (false === $amount instanceof Money\EUR && false === $amount instanceof Money\CHF) {
42-
throw new \InvalidArgumentException(sprintf(
43-
'Amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF. Instance of %s given.',
40+
if (!$amount instanceof Money\EUR && !$amount instanceof Money\CHF) {
41+
throw new InvalidArgumentException(sprintf(
42+
'The amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF (instance of %s given).',
4443
get_class($amount)
4544
));
4645
}
4746

48-
parent::__construct($instructionId, $endToEndId, $amount, $creditorName, $creditorAddress);
49-
5047
if (!$creditorAgent instanceof BC && !$creditorAgent instanceof BIC) {
51-
throw new \InvalidArgumentException('The creditor agent must be an instance of BC or BIC.');
48+
throw new InvalidArgumentException('The creditor agent must be an instance of BC or BIC.');
5249
}
5350

51+
parent::__construct($instructionId, $endToEndId, $amount, $creditorName, $creditorAddress);
52+
5453
$this->creditorIBAN = $creditorIBAN;
5554
$this->creditorAgent = $creditorAgent;
5655
}

Diff for: src/Z38/SwissPayment/TransactionInformation/IS1CreditTransfer.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Z38\SwissPayment\TransactionInformation;
44

55
use DOMDocument;
6+
use InvalidArgumentException;
67
use Z38\SwissPayment\Money;
78
use Z38\SwissPayment\PaymentInformation\PaymentInformation;
89
use Z38\SwissPayment\PostalAccount;
@@ -23,13 +24,13 @@ class IS1CreditTransfer extends CreditTransfer
2324
*
2425
* @param PostalAccount $creditorAccount Postal account of the creditor
2526
*
26-
* @throws \InvalidArgumentException. An InvalidArgumentException is thrown if amount is not EUR or CHF
27+
* @throws \InvalidArgumentException When the amount is not in EUR or CHF.
2728
*/
2829
public function __construct($instructionId, $endToEndId, Money\Money $amount, $creditorName, PostalAddressInterface $creditorAddress, PostalAccount $creditorAccount)
2930
{
30-
if (false === $amount instanceof Money\EUR && false === $amount instanceof Money\CHF) {
31-
throw new \InvalidArgumentException(sprintf(
32-
'Amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF. Instance of %s given.',
31+
if (!$amount instanceof Money\EUR && !$amount instanceof Money\CHF) {
32+
throw new InvalidArgumentException(sprintf(
33+
'The amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF (instance of %s given).',
3334
get_class($amount)
3435
));
3536
}

Diff for: src/Z38/SwissPayment/TransactionInformation/IS2CreditTransfer.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Z38\SwissPayment\TransactionInformation;
44

55
use DOMDocument;
6+
use InvalidArgumentException;
67
use Z38\SwissPayment\IBAN;
78
use Z38\SwissPayment\Money;
89
use Z38\SwissPayment\PaymentInformation\PaymentInformation;
@@ -36,13 +37,13 @@ class IS2CreditTransfer extends CreditTransfer
3637
* @param string $creditorAgentName Name of the creditor's financial institution
3738
* @param PostalAccount $creditorAgentPostal Postal account of the creditor's financial institution
3839
*
39-
* @throws \InvalidArgumentException. An InvalidArgumentException is thrown if amount is not EUR or CHF
40+
* @throws \InvalidArgumentException When the amount is not in EUR or CHF.
4041
*/
4142
public function __construct($instructionId, $endToEndId, Money\Money $amount, $creditorName, PostalAddressInterface $creditorAddress, IBAN $creditorIBAN, $creditorAgentName, PostalAccount $creditorAgentPostal)
4243
{
43-
if (false === $amount instanceof Money\EUR && false === $amount instanceof Money\CHF) {
44-
throw new \InvalidArgumentException(sprintf(
45-
'Amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF. Instance of %s given.',
44+
if (!$amount instanceof Money\EUR && !$amount instanceof Money\CHF) {
45+
throw new InvalidArgumentException(sprintf(
46+
'The amount must be an instance of Z38\SwissPayment\Money\EUR or Z38\SwissPayment\Money\CHF (instance of %s given).',
4647
get_class($amount)
4748
));
4849
}

Diff for: tests/Z38/SwissPayment/Tests/PaymentInformation/PaymentInformationTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\PaymentInformation;
44

55
use Z38\SwissPayment\BIC;
66
use Z38\SwissPayment\IBAN;
77
use Z38\SwissPayment\PaymentInformation\PaymentInformation;
8+
use Z38\SwissPayment\Tests\TestCase;
89

910
/**
1011
* @coversDefaultClass \Z38\SwissPayment\PaymentInformation\PaymentInformation

Diff for: tests/Z38/SwissPayment/Tests/PaymentInformation/SEPAPaymentInformationTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\PaymentInformation;
44

55
use Z38\SwissPayment\BIC;
66
use Z38\SwissPayment\IBAN;
77
use Z38\SwissPayment\Money;
88
use Z38\SwissPayment\PaymentInformation\SEPAPaymentInformation;
99
use Z38\SwissPayment\StructuredPostalAddress;
10+
use Z38\SwissPayment\Tests\TestCase;
1011
use Z38\SwissPayment\TransactionInformation\BankCreditTransfer;
1112
use Z38\SwissPayment\TransactionInformation\SEPACreditTransfer;
1213
use Z38\SwissPayment\UnstructuredPostalAddress;

Diff for: tests/Z38/SwissPayment/Tests/TransactionInformation/BankCreditTransferTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\TransactionInformation;
44

5+
use Z38\SwissPayment\BIC;
56
use Z38\SwissPayment\IBAN;
67
use Z38\SwissPayment\Money;
78
use Z38\SwissPayment\StructuredPostalAddress;
9+
use Z38\SwissPayment\Tests\TestCase;
810
use Z38\SwissPayment\TransactionInformation\BankCreditTransfer;
9-
use Z38\SwissPayment\BIC;
1011

1112
/**
1213
* @coversDefaultClass \Z38\SwissPayment\TransactionInformation\BankCreditTransfer

Diff for: tests/Z38/SwissPayment/Tests/TransactionInformation/ForeignCreditTransferTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\TransactionInformation;
44

55
use Z38\SwissPayment\IBAN;
66
use Z38\SwissPayment\Money;
77
use Z38\SwissPayment\StructuredPostalAddress;
8+
use Z38\SwissPayment\Tests\TestCase;
89
use Z38\SwissPayment\TransactionInformation\ForeignCreditTransfer;
910

1011
/**

Diff for: tests/Z38/SwissPayment/Tests/TransactionInformation/IS1CreditTransferTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\TransactionInformation;
44

55
use Z38\SwissPayment\Money;
6-
use Z38\SwissPayment\StructuredPostalAddress;
76
use Z38\SwissPayment\PostalAccount;
7+
use Z38\SwissPayment\StructuredPostalAddress;
8+
use Z38\SwissPayment\Tests\TestCase;
89
use Z38\SwissPayment\TransactionInformation\IS1CreditTransfer;
910

1011
/**

Diff for: tests/Z38/SwissPayment/Tests/TransactionInformation/IS2CreditTransferTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3-
namespace Z38\SwissPayment\Tests;
3+
namespace Z38\SwissPayment\Tests\TransactionInformation;
44

55
use Z38\SwissPayment\IBAN;
66
use Z38\SwissPayment\Money;
7-
use Z38\SwissPayment\StructuredPostalAddress;
87
use Z38\SwissPayment\PostalAccount;
8+
use Z38\SwissPayment\StructuredPostalAddress;
9+
use Z38\SwissPayment\Tests\TestCase;
910
use Z38\SwissPayment\TransactionInformation\IS2CreditTransfer;
1011

1112
/**

0 commit comments

Comments
 (0)