8000 [Validator] fabbot fixes · symfony/symfony@0e31c3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e31c3b

Browse files
committed
[Validator] fabbot fixes
1 parent 619fd4c commit 0e31c3b

8 files changed

+66
-66
lines changed

src/Symfony/Component/Validator/Constraints/Negative.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class Negative extends LessThan
2626
public function __construct($options = null)
2727
{
2828
if (null === $options) {
29-
$options = array();
29+
$options = [];
3030
} elseif (!\is_array($options)) {
31-
$options = array($this->getDefaultOption() => $options);
31+
$options = [$this->getDefaultOption() => $options];
3232
}
3333

3434
if (isset($options['propertyPath'])) {

src/Symfony/Component/Validator/Constraints/NegativeOrZero.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class NegativeOrZero extends LessThanOrEqual
2626
public function __construct($options = null)
2727
{
2828
if (null === $options) {
29-
$options = array();
29+
$options = [];
3030
} elseif (!\is_array($options)) {
31-
$options = array($this->getDefaultOption() => $options);
31+
$options = [$this->getDefaultOption() => $options];
3232
}
3333

3434
if (isset($options['propertyPath'])) {

src/Symfony/Component/Validator/Constraints/Positive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class Positive extends GreaterThan
2626
public function __construct($options = null)
2727
{
2828
if (null === $options) {
29-
$options = array();
29+
$options = [];
3030
} elseif (!\is_array($options)) {
31-
$options = array($this->getDefaultOption() => $options);
31+
$options = [$this->getDefaultOption() => $options];
3232
}
3333

3434
if (isset($options['propertyPath'])) {

src/Symfony/Component/Validator/Constraints/PositiveOrZero.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class PositiveOrZero extends GreaterThanOrEqual
2626
public function __construct($options = null)
2727
{
2828
if (null === $options) {
29-
$options = array();
29+
$options = [];
3030
} elseif (!\is_array($options)) {
31-
$options = array($this->getDefaultOption() => $options);
31+
$options = [$this->getDefaultOption() => $options];
3232
}
3333

3434
if (isset($options['propertyPath'])) {

src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ protected function createConstraint(array $options = null)
2828
*/
2929
public function provideValidComparisons()
3030
{
31-
return array(
32-
array(0, 0),
33-
array(1, 0),
34-
array(2, 0),
35-
array(2.5, 0),
36-
array('0', '0'),
37-
array('333', '0'),
38-
array(null, 0),
39-
);
31+
return [
32+
[0, 0],
33+
[1, 0],
34+
[2, 0],
35+
[2.5, 0],
36+
['0', '0'],
37+
['333', '0'],
38+
[null, 0],
39+
];
4040
}
4141

4242
/**
4343
* {@inheritdoc}
4444
*/
4545
public function provideInvalidComparisons()
4646
{
47-
return array(
48-
array(-1, '-1', 0, '0', 'integer'),
49-
array(-2, '-2', 0, '0', 'integer'),
50-
array(-2.5, '-2.5', 0, '0', 'integer'),
51-
);
47+
return [
48+
[-1, '-1', 0, '0', 'integer'],
49+
[-2, '-2', 0, '0', 'integer'],
50+
[-2.5, '-2.5', 0, '0', 'integer'],
51+
];
5252
}
5353

5454
/**
@@ -57,7 +57,7 @@ public function provideInvalidComparisons()
5757
*/
5858
public function testThrowsConstraintExceptionIfPropertyPath()
5959
{
60-
return new PositiveOrZero(array('propertyPath' => 'field'));
60+
return new PositiveOrZero(['propertyPath' => 'field']);
6161
}
6262

6363
/**
@@ -66,7 +66,7 @@ public function testThrowsConstraintExceptionIfPropertyPath()
6666
*/
6767
public function testThrowsConstraintExceptionIfValue()
6868
{
69-
return new PositiveOrZero(array('value' => 0));
69+
return new PositiveOrZero(['value' => 0]);
7070
}
7171

7272
/**

src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ protected function createConstraint(array $options = null)
2828
*/
2929
public function provideValidComparisons()
3030
{
31-
return array(
32-
array(2, 0),
33-
array(2.5, 0),
34-
array('333', '0'),
35-
array(null, 0),
36-
);
31+
return [
32+
[2, 0],
33+
[2.5, 0],
34+
['333', '0'],
35+
[null, 0],
36+
];
3737
}
3838

3939
/**
4040
* {@inheritdoc}
4141
*/
4242
public function provideInvalidComparisons()
4343
{
44-
return array(
45-
array(0, '0', 0, '0', 'integer' E377 ),
46-
array(-1, '-1', 0, '0', 'integer'),
47-
array(-2, '-2', 0, '0', 'integer'),
48-
array(-2.5, '-2.5', 0, '0', 'integer'),
49-
);
44+
return [
45+
[0, '0', 0, '0', 'integer'],
46+
[-1, '-1', 0, '0', 'integer'],
47+
[-2, '-2', 0, '0', 'integer'],
48+
[-2.5, '-2.5', 0, '0', 'integer'],
49+
];
5050
}
5151

5252
/**
@@ -55,7 +55,7 @@ public function provideInvalidComparisons()
5555
*/
5656
public function testThrowsConstraintExceptionIfPropertyPath()
5757
{
58-
return new Positive(array('propertyPath' => 'field'));
58+
return new Positive(['propertyPath' => 'field']);
5959
}
6060

6161
/**
@@ -64,7 +64,7 @@ public function testThrowsConstraintExceptionIfPropertyPath()
6464
*/
6565
public function testThrowsConstraintExceptionIfValue()
6666
{
67-
return new Positive(array('value' => 0));
67+
return new Positive(['value' => 0]);
6868
}
6969

7070
/**

src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ protected function createConstraint(array $options = null)
2828
*/
2929
public function provideValidComparisons()
3030
{
31-
return array(
32-
array(0, 0),
33-
array(-1, 0),
34-
array(-2, 0),
35-
array(-2.5, 0),
36-
array(null, 0),
37-
);
31+
return [
32+
[0, 0],
33+
[-1, 0],
34+
[-2, 0],
35+
[-2.5, 0],
36+
[null, 0],
37+
];
3838
}
3939

4040
/**
4141
* {@inheritdoc}
4242
*/
4343
public function provideInvalidComparisons()
4444
{
45-
return array(
46-
array(2, '2', 0, '0', 'integer'),
47-
array(2.5, '2.5', 0, '0', 'integer'),
48-
array(333, '333', 0, '0', 'integer'),
49-
);
45+
return [
46+
[2, '2', 0, '0', 'integer'],
47+
[2.5, '2.5', 0, '0', 'integer'],
48+
[333, '333', 0, '0', 'integer'],
49+
];
5050
}
5151

5252
/**
@@ -55,7 +55,7 @@ public function provideInvalidComparisons()
5555
*/
5656
public function testThrowsConstraintExceptionIfPropertyPath()
5757
{
58-
return new NegativeOrZero(array('propertyPath' => 'field'));
58+
return new NegativeOrZero(['propertyPath' => 'field']);
5959
}
6060

6161
/**
@@ -64,7 +64,7 @@ public function testThrowsConstraintExceptionIfPropertyPath()
6464
*/
6565
public function testThrowsConstraintExceptionIfValue()
6666
{
67-
return new NegativeOrZero(array('value' => 0));
67+
return new NegativeOrZero(['value' => 0]);
6868
}
6969

7070
/**

src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ protected function createConstraint(array $options = null)
2828
*/
2929
public function provideValidComparisons()
3030
{
31-
return array(
32-
array(-1, 0),
33-
array(-2, 0),
34-
array(-2.5, 0),
35-
array(null, 0),
36-
);
31+
return [
32+
[-1, 0],
33+
[-2, 0],
34+
[-2.5, 0],
35+
[null, 0],
36+
];
3737
}
3838

3939
/**
4040
* {@inheritdoc}
4141
*/
4242
public function provideInvalidComparisons()
4343
{
44-
return array(
45-
array(0, '0', 0, '0', 'integer'),
46-
array(2, '2', 0, '0', 'integer'),
47-
array(2.5, '2.5', 0, '0', 'integer'),
48-
array(333, '333', 0, '0', 'integer'),
49-
);
44+
return [
45+
[0, '0', 0, '0', 'integer'],
46+
[2, '2', 0, '0', 'integer'],
47+
[2.5, '2.5', 0, '0', 'integer'],
48+
[333, '333', 0, '0', 'integer'],
49+
];
5050
}
5151

5252
/**
@@ -55,7 +55,7 @@ public function provideInvalidComparisons()
5555
*/
5656
public function testThrowsConstraintExceptionIfPropertyPath()
5757
{
58-
return new Negative(array('propertyPath' => 'field'));
58+
return new Negative(['propertyPath' => 'field']);
5959
}
6060

6161
/**
@@ -64,7 +64,7 @@ public function testThrowsConstraintExceptionIfPropertyPath()
6464
*/
6565
public function testThrowsConstraintExceptionIfValue()
6666
{
67-
return new Negative(array('value' => 0));
67+
return new Negative(['value' => 0]);
6868
}
6969

7070
/**

0 commit comments

Comments
 (0)
0