Skip to content

Commit ba749dc

Browse files
committed
Merge branch '4.1' into 4.2
* 4.1: fixed tests fixed CS fixed CS fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents 72ac3b3 + 4a5d9e3 commit ba749dc

File tree

163 files changed

+2853
-2853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+2853
-2853
lines changed

Constraint.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class Constraint
4949
/**
5050
* Maps error codes to the names of their constants.
5151
*/
52-
protected static $errorNames = array();
52+
protected static $errorNames = [];
5353

5454
/**
5555
* Domain-specific data attached to a constraint.
@@ -105,7 +105,7 @@ public static function getErrorName($errorCode)
105105
*/
106106
public function __construct($options = null)
107107
{
108-
$invalidOptions = array();
108+
$invalidOptions = [];
109109
$missingOptions = array_flip((array) $this->getRequiredOptions());
110110
$knownOptions = get_object_vars($this);
111111

@@ -173,7 +173,7 @@ public function __set($option, $value)
173173
return;
174174
}
175175

176-
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), array($option));
176+
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), [$option]);
177177
}
178178

179179
/**
@@ -194,12 +194,12 @@ public function __set($option, $value)
194194
public function __get($option)
195195
{
196196
if ('groups' === $option) {
197-
$this->groups = array(self::DEFAULT_GROUP);
197+
$this->groups = [self::DEFAULT_GROUP];
198198

199199
return $this->groups;
200200
}
201201

202-
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), array($option));
202+
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), [$option]);
203203
}
204204

205205
/**
@@ -248,7 +248,7 @@ public function getDefaultOption()
248248
*/
249249
public function getRequiredOptions()
250250
{
251-
return array();
251+
return [];
252252
}
253253

254254
/**

ConstraintValidatorFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
2626
{
27-
protected $validators = array();
27+
protected $validators = [];
2828

2929
public function __construct()
3030
{

ConstraintViolationList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class ConstraintViolationList implements \IteratorAggregate, ConstraintViolation
2121
/**
2222
* @var ConstraintViolationInterface[]
2323
*/
24-
private $violations = array();
24+
private $violations = [];
2525

2626
/**
2727
* Creates a new constraint violation list.
2828
*
2929
* @param ConstraintViolationInterface[] $violations The constraint violations to add to the list
3030
*/
31-
public function __construct(array $violations = array())
31+
public function __construct(array $violations = [])
3232
{
3333
foreach ($violations as $violation) {
3434
$this->add($violation);
@@ -169,7 +169,7 @@ public function offsetUnset($offset)
169169
public function findByCodes($codes)
170170
{
171171
$codes = (array) $codes;
172-
$violations = array();
172+
$violations = [];
173173
foreach ($this as $violation) {
174174
if (\in_array($violation->getCode(), $codes, true)) {
175175
$violations[] = $violation;

Constraints/AbstractComparison.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract class AbstractComparison extends Constraint
3333
public function __construct($options = null)
3434
{
3535
if (null === $options) {
36-
$options = array();
36+
$options = [];
3737
}
3838

3939
if (\is_array($options)) {

Constraints/All.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class All extends Composite
2121
{
22-
public $constraints = array();
22+
public $constraints = [];
2323

2424
public function getDefaultOption()
2525
{
@@ -28,7 +28,7 @@ public function getDefaultOption()
2828

2929
public function getRequiredOptions()
3030
{
31-
return array('constraints');
31+
return ['constraints'];
3232
}
3333

3434
protected function getCompositeOption()

Constraints/Bic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ class Bic extends Constraint
2929
const INVALID_COUNTRY_CODE_ERROR = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae';
3030
const INVALID_CASE_ERROR = '11884038-3312-4ae5-9d04-699f782130c7';
3131

32-
protected static $errorNames = array(
32+
protected static $errorNames = [
3333
self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR',
3434
self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR',
3535
self::INVALID_BANK_CODE_ERROR => 'INVALID_BANK_CODE_ERROR',
3636
self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR',
3737
self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR',
38-
);
38+
];
3939

4040
public $message = 'This is not a valid Business Identifier Code (BIC).';
4141

Constraints/BicValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function validate($value, Constraint $constraint)
4545
$canonicalize = str_replace(' ', '', $value);
4646

4747
// the bic must be either 8 or 11 characters long
48-
if (!\in_array(\strlen($canonicalize), array(8, 11))) {
48+
if (!\in_array(\strlen($canonicalize), [8, 11])) {
4949
$this->context->buildViolation($constraint->message)
5050
->setParameter('{{ value }}', $this->formatValue($value))
5151
->setCode(Bic::INVALID_LENGTH_ERROR)

Constraints/Blank.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Blank extends Constraint
2323
{
2424
const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549';
2525

26-
protected static $errorNames = array(
26+
protected static $errorNames = [
2727
self::NOT_BLANK_ERROR => 'NOT_BLANK_ERROR',
28-
);
28+
];
2929

3030
public $message = 'This value should be blank.';
3131
}

Constraints/Callback.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct($options = null)
3737
}
3838

3939
if (\is_array($options) && !isset($options['callback']) && !isset($options['groups']) && !isset($options['payload'])) {
40-
$options = array('callback' => $options);
40+
$options = ['callback' => $options];
4141
}
4242

4343
parent::__construct($options);
@@ -56,6 +56,6 @@ public function getDefaultOption()
5656
*/
5757
public function getTargets()
5858
{
59-
return array(self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT);
59+
return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
6060
}
6161
}

Constraints/CardScheme.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class CardScheme extends Constraint
2727
const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e';
2828
const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed';
2929

30-
protected static $errorNames = array(
30+
protected static $errorNames = [
3131
self::NOT_NUMERIC_ERROR => 'NOT_NUMERIC_ERROR',
3232
self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR',
33-
);
33+
];
3434

3535
public $message = 'Unsupported card type or invalid card number.';
3636
public $schemes;
@@ -42,6 +42,6 @@ public function getDefaultOption()
4242

4343
public function getRequiredOptions()
4444
{
45-
return array('schemes');
45+
return ['schemes'];
4646
}
4747
}

0 commit comments

Comments
 (0)