Skip to content

Commit a7396ed

Browse files
committed
fixed CS
1 parent bd01ddf commit a7396ed

File tree

5 files changed

+142
-142
lines changed

5 files changed

+142
-142
lines changed

Constraints/BicValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
class BicValidator extends ConstraintValidator
3131
{
32-
private const BIC_COUNTRY_TO_IBAN_COUNTRY_MAP = array(
32+
private const BIC_COUNTRY_TO_IBAN_COUNTRY_MAP = [
3333
// Reference: https://www.ecbs.org/iban/france-bank-account-number.html
3434
'GF' => 'FR', // French Guiana
3535
'PF' => 'FR', // French Polynesia
@@ -46,7 +46,7 @@ class BicValidator extends ConstraintValidator
4646
'IM' => 'GB', // Isle of Man
4747
'GG' => 'GB', // Guernsey
4848
'VG' => 'GB', // British Virgin Islands
49-
);
49+
];
5050

5151
private $propertyAccessor;
5252

Constraints/CardSchemeValidator.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,66 @@
2727
*/
2828
class CardSchemeValidator extends ConstraintValidator
2929
{
30-
protected $schemes = array(
30+
protected $schemes = [
3131
// American Express card numbers start with 34 or 37 and have 15 digits.
32-
'AMEX' => array(
32+
'AMEX' => [
3333
'/^3[47][0-9]{13}$/',
34-
),
34+
],
3535
// China UnionPay cards start with 62 and have between 16 and 19 digits.
3636
// Please note that these cards do not follow Luhn Algorithm as a checksum.
37-
'CHINA_UNIONPAY' => array(
37+
'CHINA_UNIONPAY' => [
3838
'/^62[0-9]{14,17}$/',
39-
),
39+
],
4040
// Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits.
4141
// There are Diners Club cards that begin with 5 and have 16 digits.
4242
// These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard.
43-
'DINERS' => array(
43+
'DINERS' => [
4444
'/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/',
45-
),
45+
],
4646
// Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65.
4747
// All have 16 digits.
48-
'DISCOVER' => array(
48+
'DISCOVER' => [
4949
'/^6011[0-9]{12}$/',
5050
'/^64[4-9][0-9]{13}$/',
5151
'/^65[0-9]{14}$/',
5252
'/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/',
53-
),
53+
],
5454
// InstaPayment cards begin with 637 through 639 and have 16 digits.
55-
'INSTAPAYMENT' => array(
55+
'INSTAPAYMENT' => [
5656
'/^63[7-9][0-9]{13}$/',
57-
),
57+
],
5858
// JCB cards beginning with 2131 or 1800 have 15 digits.
5959
// JCB cards beginning with 35 have 16 digits.
60-
'JCB' => array(
60+
'JCB' => [
6161
'/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/',
62-
),
62+
],
6363
// Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits.
64-
'LASER' => array(
64+
'LASER' => [
6565
'/^(6304|670[69]|6771)[0-9]{12,15}$/',
66-
),
66+
],
6767
// Maestro international cards begin with 675900..675999 and have between 12 and 19 digits.
6868
// Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits.
69-
'MAESTRO' => array(
69+
'MAESTRO' => [
7070
'/^(6759[0-9]{2})[0-9]{6,13}$/',
7171
'/^(50[0-9]{4})[0-9]{6,13}$/',
7272
'/^5[6-9][0-9]{10,17}$/',
7373
'/^6[0-9]{11,18}$/',
74-
),
74+
],
7575
// All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.
7676
// October 2016 MasterCard numbers can also start with 222100 through 272099.
77-
'MASTERCARD' => array(
77+
'MASTERCARD' => [
7878
'/^5[1-5][0-9]{14}$/',
7979
'/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/',
80-
),
80+
],
8181
// All UATP card numbers start with a 1 and have a length of 15 digits.
82-
'UATP' => array(
82+
'UATP' => [
8383
'/^1[0-9]{14}$/',
84-
),
84+
],
8585
// All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits.
86-
'VISA' => array(
86+
'VISA' => [
8787
'/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/',
88-
),
89-
);
88+
],
89+
];
9090

9191
/**
9292
* Validates a creditcard belongs to a specified scheme.

Tests/Constraints/BicValidatorTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testEmptyStringIsValid()
3939

4040
public function testValidComparisonToPropertyPath()
4141
{
42-
$constraint = new Bic(array('ibanPropertyPath' => 'value'));
42+
$constraint = new Bic(['ibanPropertyPath' => 'value']);
4343

4444
$object = new BicComparisonTestClass('FR14 2004 1010 0505 0001 3M02 606');
4545

@@ -52,9 +52,9 @@ public function testValidComparisonToPropertyPath()
5252

5353
public function testValidComparisonToPropertyPathOnArray()
5454
{
55-
$constraint = new Bic(array('ibanPropertyPath' => '[root][value]'));
55+
$constraint = new Bic(['ibanPropertyPath' => '[root][value]']);
5656

57-
$this->setObject(array('root' => array('value' => 'FR14 2004 1010 0505 0001 3M02 606')));
57+
$this->setObject(['root' => ['value' => 'FR14 2004 1010 0505 0001 3M02 606']]);
5858

5959
$this->validator->validate('SOGEFRPP', $constraint);
6060

@@ -63,7 +63,7 @@ public function testValidComparisonToPropertyPathOnArray()
6363

6464
public function testInvalidComparisonToPropertyPath()
6565
{
66-
$constraint = new Bic(array('ibanPropertyPath' => 'value'));
66+
$constraint = new Bic(['ibanPropertyPath' => 'value']);
6767
$constraint->ibanMessage = 'Constraint Message';
6868

6969
$object = new BicComparisonTestClass('FR14 2004 1010 0505 0001 3M02 606');
@@ -81,7 +81,7 @@ public function testInvalidComparisonToPropertyPath()
8181

8282
public function testValidComparisonToValue()
8383
{
84-
$constraint = new Bic(array('iban' => 'FR14 2004 1010 0505 0001 3M02 606'));
84+
$constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']);
8585
$constraint->ibanMessage = 'Constraint Message';
8686

8787
$this->validator->validate('SOGEFRPP', $constraint);
@@ -91,7 +91,7 @@ public function testValidComparisonToValue()
9191

9292
public function testInvalidComparisonToValue()
9393
{
94-
$constraint = new Bic(array('iban' => 'FR14 2004 1010 0505 0001 3M02 606'));
94+
$constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']);
9595
$constraint->ibanMessage = 'Constraint Message';
9696

9797
$this->validator->validate('UNCRIT2B912', $constraint);
@@ -105,7 +105,7 @@ public function testInvalidComparisonToValue()
105105

106106
public function testNoViolationOnNullObjectWithPropertyPath()
107107
{
108-
$constraint = new Bic(array('ibanPropertyPath' => 'propertyPath'));
108+
$constraint = new Bic(['ibanPropertyPath' => 'propertyPath']);
109109

110110
$this->setObject(null);
111111

@@ -120,15 +120,15 @@ public function testNoViolationOnNullObjectWithPropertyPath()
120120
*/
121121
public function testThrowsConstraintExceptionIfBothValueAndPropertyPath()
122122
{
123-
new Bic(array(
123+
new Bic([
124124
'iban' => 'value',
125125
'ibanPropertyPath' => 'propertyPath',
126-
));
126+
]);
127127
}
128128

129129
public function testInvalidValuePath()
130130
{
131-
$constraint = new Bic(array('ibanPropertyPath' => 'foo'));
131+
$constraint = new Bic(['ibanPropertyPath' => 'foo']);
132132

133133
if (method_exists($this, 'expectException')) {
134134
$this->expectException(ConstraintDefinitionException::class);
@@ -230,7 +230,7 @@ public function getInvalidBics()
230230
*/
231231
public function testValidBicSpecialCases(string $bic, string $iban)
232232
{
233-
$constraint = new Bic(array('iban' => $iban));
233+
$constraint = new Bic(['iban' => $iban]);
234234
$this->validator->validate($bic, $constraint);
235235

236236
$this->assertNoViolation();
@@ -239,22 +239,22 @@ public function testValidBicSpecialCases(string $bic, string $iban)
239239
public function getValidBicSpecialCases()
240240
{
241241
// FR related special cases
242-
yield array('BNPAGFGX', 'FR14 2004 1010 0505 0001 3M02 606');
243-
yield array('BNPAPFGX', 'FR14 2004 1010 0505 0001 3M02 606');
244-
yield array('BNPATFGX', 'FR14 2004 1010 0505 0001 3M02 606');
245-
yield array('BNPAGPGX', 'FR14 2004 1010 0505 0001 3M02 606');
246-
yield array('BNPAMQGX', 'FR14 2004 1010 0505 0001 3M02 606');
247-
yield array('BNPAYTGX', 'FR14 2004 1010 0505 0001 3M02 606');
248-
yield array('BNPANCGX', 'FR14 2004 1010 0505 0001 3M02 606');
249-
yield array('BNPAREGX', 'FR14 2004 1010 0505 0001 3M02 606');
250-
yield array('BNPAPMGX', 'FR14 2004 1010 0505 0001 3M02 606');
251-
yield array('BNPAWFGX', 'FR14 2004 1010 0505 0001 3M02 606');
242+
yield ['BNPAGFGX', 'FR14 2004 1010 0505 0001 3M02 606'];
243+
yield ['BNPAPFGX', 'FR14 2004 1010 0505 0001 3M02 606'];
244+
yield ['BNPATFGX', 'FR14 2004 1010 0505 0001 3M02 606'];
245+
yield ['BNPAGPGX', 'FR14 2004 1010 0505 0001 3M02 606'];
246+
yield ['BNPAMQGX', 'FR14 2004 1010 0505 0001 3M02 606'];
247+
yield ['BNPAYTGX', 'FR14 2004 1010 0505 0001 3M02 606'];
248+
yield ['BNPANCGX', 'FR14 2004 1010 0505 0001 3M02 606'];
249+
yield ['BNPAREGX', 'FR14 2004 1010 0505 0001 3M02 606'];
250+
yield ['BNPAPMGX', 'FR14 2004 1010 0505 0001 3M02 606'];
251+
yield ['BNPAWFGX', 'FR14 2004 1010 0505 0001 3M02 606'];
252252

253253
// GB related special cases
254-
yield array('BARCJESA', 'GB12 CPBK 0892 9965 0449 911');
255-
yield array('BARCIMSA', 'GB12 CPBK 0892 9965 0449 911');
256-
yield array('BARCGGSA', 'GB12 CPBK 0892 9965 0449 911');
257-
yield array('BARCVGSA', 'GB12 CPBK 0892 9965 0449 911');
254+
yield ['BARCJESA', 'GB12 CPBK 0892 9965 0449 911'];
255+
yield ['BARCIMSA', 'GB12 CPBK 0892 9965 0449 911'];
256+
yield ['BARCGGSA', 'GB12 CPBK 0892 9965 0449 911'];
257+
yield ['BARCVGSA', 'GB12 CPBK 0892 9965 0449 911'];
258258
}
259259
}
260260

0 commit comments

Comments
 (0)