Skip to content

Commit b068ca8

Browse files
committed
fixed CS
1 parent ba749dc commit b068ca8

File tree

8 files changed

+69
-69
lines changed

8 files changed

+69
-69
lines changed

Constraints/DivisibleBy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class DivisibleBy extends AbstractComparison
2121
{
2222
const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c';
2323

24-
protected static $errorNames = array(
24+
protected static $errorNames = [
2525
self::NOT_DIVISIBLE_BY => 'NOT_DIVISIBLE_BY',
26-
);
26+
];
2727

2828
public $message = 'This value should be a multiple of {{ compared_value }}.';
2929
}

DependencyInjection/AddValidatorInitializersPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ public function process(ContainerBuilder $container)
4040
return;
4141
}
4242

43-
$initializers = array();
43+
$initializers = [];
4444
foreach ($container->findTaggedServiceIds($this->initializerTag, true) as $id => $attributes) {
4545
$initializers[] = new Reference($id);
4646
}
4747

48-
$container->getDefinition($this->builderService)->addMethodCall('addObjectInitializers', array($initializers));
48+
$container->getDefinition($this->builderService)->addMethodCall('addObjectInitializers', [$initializers]);
4949

5050
// @deprecated logic, to be removed in Symfony 5.0
5151
$builder = $container->getDefinition($this->builderService);
52-
$calls = array();
52+
$calls = [];
5353

5454
foreach ($builder->getMethodCalls() as list($method, $arguments)) {
5555
if ('setTranslator' === $method) {
@@ -70,7 +70,7 @@ public function process(ContainerBuilder $container)
7070
}
7171
}
7272

73-
$calls[] = array($method, $arguments);
73+
$calls[] = [$method, $arguments];
7474
}
7575

7676
$builder->setMethodCalls($calls);

Tests/Constraints/BicValidatorTest.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,24 @@ public function testValidBics($bic)
5757
public function getValidBics()
5858
{
5959
// http://formvalidation.io/validators/bic/
60-
return array(
61-
array('ASPKAT2LXXX'),
62-
array('ASPKAT2L'),
63-
array('DSBACNBXSHA'),
64-
array('UNCRIT2B912'),
65-
array('DABADKKK'),
66-
array('RZOOAT2L303'),
67-
);
60+
return [
61+
['ASPKAT2LXXX'],
62+
['ASPKAT2L'],
63+
['DSBACNBXSHA'],
64+
['UNCRIT2B912'],
65+
['DABADKKK'],
66+
['RZOOAT2L303'],
67+
];
6868
}
6969

7070
/**
7171
* @dataProvider getInvalidBics
7272
*/
7373
public function testInvalidBics($bic, $code)
7474
{
75-
$constraint = new Bic(array(
75+
$constraint = new Bic([
7676
'message' => 'myMessage',
77-
));
77+
]);
7878

7979
$this->validator->validate($bic, $constraint);
8080

@@ -86,31 +86,31 @@ public function testInvalidBics($bic, $code)
8686

8787
public function getInvalidBics()
8888
{
89-
return array(
90-
array('DEUTD', Bic::INVALID_LENGTH_ERROR),
91-
array('ASPKAT2LXX', Bic::INVALID_LENGTH_ERROR),
92-
array('ASPKAT2LX', Bic::INVALID_LENGTH_ERROR),
93-
array('ASPKAT2LXXX1', Bic::INVALID_LENGTH_ERROR),
94-
array('DABADKK', Bic::INVALID_LENGTH_ERROR),
95-
array('1SBACNBXSHA', Bic::INVALID_BANK_CODE_ERROR),
96-
array('RZ00AT2L303', Bic::INVALID_BANK_CODE_ERROR),
97-
array('D2BACNBXSHA', Bic::INVALID_BANK_CODE_ERROR),
98-
array('DS3ACNBXSHA', Bic::INVALID_BANK_CODE_ERROR),
99-
array('DSB4CNBXSHA', Bic::INVALID_BANK_CODE_ERROR),
100-
array('DEUT12HH', Bic::INVALID_COUNTRY_CODE_ERROR),
101-
array('DSBAC6BXSHA', Bic::INVALID_COUNTRY_CODE_ERROR),
102-
array('DSBA5NBXSHA', Bic::INVALID_COUNTRY_CODE_ERROR),
103-
array('DSBAAABXSHA', Bic::INVALID_COUNTRY_CODE_ERROR),
89+
return [
90+
['DEUTD', Bic::INVALID_LENGTH_ERROR],
91+
['ASPKAT2LXX', Bic::INVALID_LENGTH_ERROR],
92+
['ASPKAT2LX', Bic::INVALID_LENGTH_ERROR],
93+
['ASPKAT2LXXX1', Bic::INVALID_LENGTH_ERROR],
94+
['DABADKK', Bic::INVALID_LENGTH_ERROR],
95+
['1SBACNBXSHA', Bic::INVALID_BANK_CODE_ERROR],
96+
['RZ00AT2L303', Bic::INVALID_BANK_CODE_ERROR],
97+
['D2BACNBXSHA', Bic::INVALID_BANK_CODE_ERROR],
98+
['DS3ACNBXSHA', Bic::INVALID_BANK_CODE_ERROR],
99+
['DSB4CNBXSHA', Bic::INVALID_BANK_CODE_ERROR],
100+
['DEUT12HH', Bic::INVALID_COUNTRY_CODE_ERROR],
101+
['DSBAC6BXSHA', Bic::INVALID_COUNTRY_CODE_ERROR],
102+
['DSBA5NBXSHA', Bic::INVALID_COUNTRY_CODE_ERROR],
103+
['DSBAAABXSHA', Bic::INVALID_COUNTRY_CODE_ERROR],
104104

105105
// branch code error
106-
array('THISSVAL1D]', Bic::INVALID_CHARACTERS_ERROR),
106+
['THISSVAL1D]', Bic::INVALID_CHARACTERS_ERROR],
107107

108108
// location code error
109-
array('DEUTDEF]', Bic::INVALID_CHARACTERS_ERROR),
109+
['DEUTDEF]', Bic::INVALID_CHARACTERS_ERROR],
110110

111111
// lower case values are invalid
112-
array('DeutAT2LXXX', Bic::INVALID_CASE_ERROR),
113-
array('DEUTAT2lxxx', Bic::INVALID_CASE_ERROR),
114-
);
112+
['DeutAT2LXXX', Bic::INVALID_CASE_ERROR],
113+
['DEUTAT2lxxx', Bic::INVALID_CASE_ERROR],
114+
];
115115
}
116116
}

Tests/Constraints/DivisibleByValidatorTest.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,40 @@ protected function getErrorCode()
3939
*/
4040
public function provideValidComparisons()
4141
{
42-
return array(
43-
array(-7, 1),
44-
array(0, 3.1415),
45-
array(42, 42),
46-
array(42, 21),
47-
array(3.25, 0.25),
48-
array('100', '10'),
49-
array(4.1, 0.1),
50-
array(-4.1, 0.1),
51-
);
42+
return [
43+
[-7, 1],
44+
[0, 3.1415],
45+
[42, 42],
46+
[42, 21],
47+
[3.25, 0.25],
48+
['100', '10'],
49+
[4.1, 0.1],
50+
[-4.1, 0.1],
51+
];
5252
}
5353

5454
/**
5555
* {@inheritdoc}
5656
*/
5757
public function provideValidComparisonsToPropertyPath()
5858
{
59-
return array(
60-
array(25),
61-
);
59+
return [
60+
[25],
61+
];
6262
}
6363

6464
/**
6565
* {@inheritdoc}
6666
*/
6767
public function provideInvalidComparisons()
6868
{
69-
return array(
70-
array(1, '1', 2, '2', 'integer'),
71-
array(10, '10', 3, '3', 'integer'),
72-
array(10, '10', 0, '0', 'integer'),
73-
array(42, '42', INF, 'INF', 'double'),
74-
array(4.15, '4.15', 0.1, '0.1', 'double'),
75-
array('22', '"22"', '10', '"10"', 'string'),
76-
);
69+
return [
70+
[1, '1', 2, '2', 'integer'],
71+
[10, '10', 3, '3', 'integer'],
72+
[10, '10', 0, '0', 'integer'],
73+
[42, '42', INF, 'INF', 'double'],
74+
[4.15, '4.15', 0.1, '0.1', 'double'],
75+
['22', '"22"', '10', '"10"', 'string'],
76+
];
7777
}
7878
}

Tests/DependencyInjection/AddValidatorInitializersPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public function testLegacyTranslatorProxy()
5959
$container = new ContainerBuilder();
6060
$container
6161
->register('validator.builder')
62-
->addMethodCall('setTranslator', array(new Reference('translator')))
62+
->addMethodCall('setTranslator', [new Reference('translator')])
6363
;
6464

6565
$container->register('translator', TestTranslator::class);
6666

6767
(new AddValidatorInitializersPass())->process($container);
6868

6969
$this->assertEquals(
70-
array(array('setTranslator', array((new Definition(LegacyTranslatorProxy::class))->addArgument(new Reference('translator'))))),
70+
[['setTranslator', [(new Definition(LegacyTranslatorProxy::class))->addArgument(new Reference('translator'))]]],
7171
$container->getDefinition('validator.builder')->removeMethodCall('addObjectInitializers')->getMethodCalls()
7272
);
7373
}

Util/LegacyTranslatorProxy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ public function getLocale()
5454
/**
5555
* {@inheritdoc}
5656
*/
57-
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
57+
public function trans($id, array $parameters = [], $domain = null, $locale = null)
5858
{
5959
return $this->translator->trans($id, $parameters, $domain, $locale);
6060
}
6161

6262
/**
6363
* {@inheritdoc}
6464
*/
65-
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
65+
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
6666
{
67-
return $this->translator->trans($id, array('%count%' => $number) + $parameters, $domain, $locale);
67+
return $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
6868
}
6969
}

ValidatorBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
*/
4444
class ValidatorBuilder implements ValidatorBuilderInterface
4545
{
46-
private $initializers = array();
47-
private $loaders = array();
48-
private $xmlMappings = array();
49-
private $yamlMappings = array();
50-
private $methodMappings = array();
46+
private $initializers = [];
47+
private $loaders = [];
48+
private $xmlMappings = [];
49+
private $yamlMappings = [];
50+
private $methodMappings = [];
5151

5252
/**
5353
* @var Reader|null
@@ -288,7 +288,7 @@ public function addLoader(LoaderInterface $loader)
288288
*/
289289
public function getLoaders()
290290
{
291-
$loaders = array();
291+
$loaders = [];
292292

293293
foreach ($this->xmlMappings as $xmlMapping) {
294294
$loaders[] = new XmlFileLoader($xmlMapping);

Violation/ConstraintViolationBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function addViolation()
157157
} elseif ($this->translator instanceof TranslatorInterface) {
158158
$translatedMessage = $this->translator->trans(
159159
$this->message,
160-
array('%count%' => $this->plural) + $this->parameters,
160+
['%count%' => $this->plural] + $this->parameters,
161161
$this->translationDomain
162162
);
163163
} else {

0 commit comments

Comments
 (0)