[Validator] fix comparisons with null values at property paths

by @xabbuh

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

$ curl https://fabbot.io/patch/symfony/symfony/29839/99df763e3585fde1c079b2ad846e14e617cc7c8d/cs.diff | patch -p0
diff -ru src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
--- src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php	2019-01-10 20:33:38.853004858 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php	2019-01-10 20:33:40.525968136 +0000
@@ -73,10 +73,10 @@
 
     public function provideInvalidConstraintOptions()
     {
-        return array(
-            array(null),
-            array(array()),
-        );
+        return [
+            [null],
+            [[]],
+        ];
     }
 
     /**
@@ -95,10 +95,10 @@
      */
     public function testThrowsConstraintExceptionIfBothValueAndPropertyPath()
     {
-        $this->createConstraint((array(
+        $this->createConstraint(([
             'value' => 'value',
             'propertyPath' => 'propertyPath',
-        )));
+        ]));
     }
 
     /**
@@ -109,7 +109,7 @@
      */
     public function testValidComparisonToValue($dirtyValue, $comparisonValue)
     {
-        $constraint = $this->createConstraint(array('value' => $comparisonValue));
+        $constraint = $this->createConstraint(['value' => $comparisonValue]);
 
         $this->validator->validate($dirtyValue, $constraint);
 
@@ -137,7 +137,7 @@
      */
     public function testValidComparisonToPropertyPath($comparedValue)
     {
-        $constraint = $this->createConstraint(array('propertyPath' => 'value'));
+        $constraint = $this->createConstraint(['propertyPath' => 'value']);
 
         $object = new ComparisonTest_Class(5);
 
@@ -153,9 +153,9 @@
      */
     public function testValidComparisonToPropertyPathOnArray($comparedValue)
     {
-        $constraint = $this->createConstraint(array('propertyPath' => '[root][value]'));
+        $constraint = $this->createConstraint(['propertyPath' => '[root][value]']);
 
-        $this->setObject(array('root' => array('value' => 5)));
+        $this->setObject(['root' => ['value' => 5]]);
 
         $this->validator->validate($comparedValue, $constraint);
 
@@ -164,7 +164,7 @@
 
     public function testNoViolationOnNullObjectWithPropertyPath()
     {
-        $constraint = $this->createConstraint(array('propertyPath' => 'propertyPath'));
+        $constraint = $this->createConstraint(['propertyPath' => 'propertyPath']);
 
         $this->setObject(null);
 
@@ -175,7 +175,7 @@
 
     public function testInvalidValuePath()
     {
-        $constraint = $this->createConstraint(array('propertyPath' => 'foo'));
+        $constraint = $this->createConstraint(['propertyPath' => 'foo']);
 
         if (method_exists($this, 'expectException')) {
             $this->expectException(ConstraintDefinitionException::class);
@@ -218,7 +218,7 @@
             IntlTestHelper::requireIntl($this, '57.1');
         }
 
-        $constraint = $this->createConstraint(array('value' => $comparedValue));
+        $constraint = $this->createConstraint(['value' => $comparedValue]);
         $constraint->message = 'Constraint Message';
 
         $this->validator->validate($dirtyValue, $constraint);
diff -ru src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php	2019-01-10 20:33:39.011001390 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php	2019-01-10 20:33:40.567967214 +0000
@@ -39,16 +39,16 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(3, 3),
-            array(3, '3'),
-            array('a', 'a'),
-            array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')),
-            array(new \DateTime('2000-01-01'), '2000-01-01'),
-            array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'),
-            array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)),
-            array(null, 1),
-        );
+        return [
+            [3, 3],
+            [3, '3'],
+            ['a', 'a'],
+            [new \DateTime('2000-01-01'), new \DateTime('2000-01-01')],
+            [new \DateTime('2000-01-01'), '2000-01-01'],
+            [new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'],
+            [new ComparisonTest_Class(5), new ComparisonTest_Class(5)],
+            [null, 1],
+        ];
     }
 
     /**
@@ -56,9 +56,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(5),
-        );
+        return [
+            [5],
+        ];
     }
 
     /**
@@ -66,14 +66,14 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(1, '1', 2, '2', 'integer'),
-            array('22', '"22"', '333', '"333"', 'string'),
-            array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2001-01-01 UTC'), 'Jan 1, 2001, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-        );
+        return [
+            [1, '1', 2, '2', 'integer'],
+            ['22', '"22"', '333', '"333"', 'string'],
+            [new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2001-01-01 UTC'), 'Jan 1, 2001, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php	2019-01-10 20:33:39.170997878 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php	2019-01-10 20:33:40.611966248 +0000
@@ -39,19 +39,19 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(3, 2),
-            array(1, 1),
-            array(new \DateTime('2010/01/01'), new \DateTime('2000/01/01')),
-            array(new \DateTime('2000/01/01'), new \DateTime('2000/01/01')),
-            array(new \DateTime('2010/01/01'), '2000/01/01'),
-            array(new \DateTime('2000/01/01'), '2000/01/01'),
-            array(new \DateTime('2010/01/01 UTC'), '2000/01/01 UTC'),
-            array(new \DateTime('2000/01/01 UTC'), '2000/01/01 UTC'),
-            array('a', 'a'),
-            array('z', 'a'),
-            array(null, 1),
-        );
+        return [
+            [3, 2],
+            [1, 1],
+            [new \DateTime('2010/01/01'), new \DateTime('2000/01/01')],
+            [new \DateTime('2000/01/01'), new \DateTime('2000/01/01')],
+            [new \DateTime('2010/01/01'), '2000/01/01'],
+            [new \DateTime('2000/01/01'), '2000/01/01'],
+            [new \DateTime('2010/01/01 UTC'), '2000/01/01 UTC'],
+            [new \DateTime('2000/01/01 UTC'), '2000/01/01 UTC'],
+            ['a', 'a'],
+            ['z', 'a'],
+            [null, 1],
+        ];
     }
 
     /**
@@ -59,10 +59,10 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(5),
-            array(6),
-        );
+        return [
+            [5],
+            [6],
+        ];
     }
 
     /**
@@ -70,13 +70,13 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(1, '1', 2, '2', 'integer'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array('b', '"b"', 'c', '"c"', 'string'),
-        );
+        return [
+            [1, '1', 2, '2', 'integer'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            ['b', '"b"', 'c', '"c"', 'string'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php	2019-01-10 20:33:39.315994696 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php	2019-01-10 20:33:40.667965019 +0000
@@ -39,15 +39,15 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(2, 1),
-            array(new \DateTime('2005/01/01'), new \DateTime('2001/01/01')),
-            array(new \DateTime('2005/01/01'), '2001/01/01'),
-            array(new \DateTime('2005/01/01 UTC'), '2001/01/01 UTC'),
-            array(new ComparisonTest_Class(5), new ComparisonTest_Class(4)),
-            array('333', '22'),
-            array(null, 1),
-        );
+        return [
+            [2, 1],
+            [new \DateTime('2005/01/01'), new \DateTime('2001/01/01')],
+            [new \DateTime('2005/01/01'), '2001/01/01'],
+            [new \DateTime('2005/01/01 UTC'), '2001/01/01 UTC'],
+            [new ComparisonTest_Class(5), new ComparisonTest_Class(4)],
+            ['333', '22'],
+            [null, 1],
+        ];
     }
 
     /**
@@ -55,9 +55,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(6),
-        );
+        return [
+            [6],
+        ];
     }
 
     /**
@@ -65,20 +65,20 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(1, '1', 2, '2', 'integer'),
-            array(2, '2', 2, '2', 'integer'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2000/01/01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000/01/01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-            array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-            array('22', '"22"', '333', '"333"', 'string'),
-            array('22', '"22"', '22', '"22"', 'string'),
-        );
+        return [
+            [1, '1', 2, '2', 'integer'],
+            [2, '2', 2, '2', 'integer'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2000/01/01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000/01/01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+            [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+            ['22', '"22"', '333', '"333"', 'string'],
+            ['22', '"22"', '22', '"22"', 'string'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php	2019-01-10 20:33:39.482991030 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php	2019-01-10 20:33:40.711964053 +0000
@@ -55,16 +55,16 @@
         $date = new \DateTime('2000-01-01');
         $object = new ComparisonTest_Class(2);
 
-        $comparisons = array(
-            array(3, 3),
-            array('a', 'a'),
-            array($date, $date),
-            array($object, $object),
-            array(null, 1),
-        );
+        $comparisons = [
+            [3, 3],
+            ['a', 'a'],
+            [$date, $date],
+            [$object, $object],
+            [null, 1],
+        ];
 
         $immutableDate = new \DateTimeImmutable('2000-01-01');
-        $comparisons[] = array($immutableDate, $immutableDate);
+        $comparisons[] = [$immutableDate, $immutableDate];
 
         return $comparisons;
     }
@@ -74,9 +74,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(5),
-        );
+        return [
+            [5],
+        ];
     }
 
     /**
@@ -84,14 +84,14 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(1, '1', 2, '2', 'integer'),
-            array(2, '2', '2', '"2"', 'string'),
-            array('22', '"22"', '333', '"333"', 'string'),
-            array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('1999-01-01'), 'Jan 1, 1999, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-        );
+        return [
+            [1, '1', 2, '2', 'integer'],
+            [2, '2', '2', '"2"', 'string'],
+            ['22', '"22"', '333', '"333"', 'string'],
+            [new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', 'DateTime'],
+            [new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('1999-01-01'), 'Jan 1, 1999, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php	2019-01-10 20:33:39.643987496 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php	2019-01-10 20:33:40.758963021 +0000
@@ -39,21 +39,21 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(1, 2),
-            array(1, 1),
-            array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')),
-            array(new \DateTime('2000-01-01'), new \DateTime('2020-01-01')),
-            array(new \DateTime('2000-01-01'), '2000-01-01'),
-            array(new \DateTime('2000-01-01'), '2020-01-01'),
-            array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'),
-            array(new \DateTime('2000-01-01 UTC'), '2020-01-01 UTC'),
-            array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)),
-            array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)),
-            array('a', 'a'),
-            array('a', 'z'),
-            array(null, 1),
-        );
+        return [
+            [1, 2],
+            [1, 1],
+            [new \DateTime('2000-01-01'), new \DateTime('2000-01-01')],
+            [new \DateTime('2000-01-01'), new \DateTime('2020-01-01')],
+            [new \DateTime('2000-01-01'), '2000-01-01'],
+            [new \DateTime('2000-01-01'), '2020-01-01'],
+            [new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'],
+            [new \DateTime('2000-01-01 UTC'), '2020-01-01 UTC'],
+            [new ComparisonTest_Class(4), new ComparisonTest_Class(5)],
+            [new ComparisonTest_Class(5), new ComparisonTest_Class(5)],
+            ['a', 'a'],
+            ['a', 'z'],
+            [null, 1],
+        ];
     }
 
     /**
@@ -61,10 +61,10 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(4),
-            array(5),
-        );
+        return [
+            [4],
+            [5],
+        ];
     }
 
     /**
@@ -72,14 +72,14 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(2, '2', 1, '1', 'integer'),
-            array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(4), '4', __NAMESPACE__.'\ComparisonTest_Class'),
-            array('c', '"c"', 'b', '"b"', 'string'),
-        );
+        return [
+            [2, '2', 1, '1', 'integer'],
+            [new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(4), '4', __NAMESPACE__.'\ComparisonTest_Class'],
+            ['c', '"c"', 'b', '"b"', 'string'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php	2019-01-10 20:33:39.815983720 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php	2019-01-10 20:33:40.813961814 +0000
@@ -39,15 +39,15 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(1, 2),
-            array(new \DateTime('2000-01-01'), new \DateTime('2010-01-01')),
-            array(new \DateTime('2000-01-01'), '2010-01-01'),
-            array(new \DateTime('2000-01-01 UTC'), '2010-01-01 UTC'),
-            array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)),
-            array('22', '333'),
-            array(null, 1),
-        );
+        return [
+            [1, 2],
+            [new \DateTime('2000-01-01'), new \DateTime('2010-01-01')],
+            [new \DateTime('2000-01-01'), '2010-01-01'],
+            [new \DateTime('2000-01-01 UTC'), '2010-01-01 UTC'],
+            [new ComparisonTest_Class(4), new ComparisonTest_Class(5)],
+            ['22', '333'],
+            [null, 1],
+        ];
     }
 
     /**
@@ -55,9 +55,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(4),
-        );
+        return [
+            [4],
+        ];
     }
 
     /**
@@ -65,19 +65,19 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(3, '3', 2, '2', 'integer'),
-            array(2, '2', 2, '2', 'integer'),
-            array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-            array(new ComparisonTest_Class(6), '6', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-            array('333', '"333"', '22', '"22"', 'string'),
-        );
+        return [
+            [3, '3', 2, '2', 'integer'],
+            [2, '2', 2, '2', 'integer'],
+            [new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+            [new ComparisonTest_Class(6), '6', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+            ['333', '"333"', '22', '"22"', 'string'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php	2019-01-10 20:33:39.989979901 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php	2019-01-10 20:33:40.857960848 +0000
@@ -39,15 +39,15 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(1, 2),
-            array('22', '333'),
-            array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')),
-            array(new \DateTime('2001-01-01'), '2000-01-01'),
-            array(new \DateTime('2001-01-01 UTC'), '2000-01-01 UTC'),
-            array(new ComparisonTest_Class(6), new ComparisonTest_Class(5)),
-            array(null, 1),
-        );
+        return [
+            [1, 2],
+            ['22', '333'],
+            [new \DateTime('2001-01-01'), new \DateTime('2000-01-01')],
+            [new \DateTime('2001-01-01'), '2000-01-01'],
+            [new \DateTime('2001-01-01 UTC'), '2000-01-01 UTC'],
+            [new ComparisonTest_Class(6), new ComparisonTest_Class(5)],
+            [null, 1],
+        ];
     }
 
     /**
@@ -55,9 +55,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(0),
-        );
+        return [
+            [0],
+        ];
     }
 
     /**
@@ -65,15 +65,15 @@
      */
     public function provideInvalidComparisons()
     {
-        return array(
-            array(3, '3', 3, '3', 'integer'),
-            array('2', '"2"', 2, '2', 'integer'),
-            array('a', '"a"', 'a', '"a"', 'string'),
-            array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
-        );
+        return [
+            [3, '3', 3, '3', 'integer'],
+            ['2', '"2"', 2, '2', 'integer'],
+            ['a', '"a"', 'a', '"a"', 'string'],
+            [new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
+        ];
     }
 
     public function provideComparisonsToNullValueAtPropertyPath()
diff -ru src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
--- src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php	2019-01-10 20:33:40.169975950 +0000
+++ src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php	2019-01-10 20:33:40.907959751 +0000
@@ -39,18 +39,18 @@
      */
     public function provideValidComparisons()
     {
-        return array(
-            array(1, 2),
-            array('2', 2),
-            array('22', '333'),
-            array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')),
-            array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')),
-            array(new \DateTime('2001-01-01'), '2000-01-01'),
-            array(new \DateTime('2000-01-01'), '2000-01-01'),
-            array(new \DateTime('2001-01-01'), '2000-01-01'),
-            array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'),
-            array(null, 1),
-        );
+        return [
+            [1, 2],
+            ['2', 2],
+            ['22', '333'],
+            [new \DateTime('2001-01-01'), new \DateTime('2000-01-01')],
+            [new \DateTime('2000-01-01'), new \DateTime('2000-01-01')],
+            [new \DateTime('2001-01-01'), '2000-01-01'],
+            [new \DateTime('2000-01-01'), '2000-01-01'],
+            [new \DateTime('2001-01-01'), '2000-01-01'],
+            [new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'],
+            [null, 1],
+        ];
     }
 
     /**
@@ -58,9 +58,9 @@
      */
     public function provideValidComparisonsToPropertyPath()
     {
-        return array(
-            array(0),
-        );
+        return [
+            [0],
+        ];
     }
 
     public function provideAllInvalidComparisons()
@@ -84,12 +84,12 @@
         $date = new \DateTime('2000-01-01');
         $object = new ComparisonTest_Class(2);
 
-        $comparisons = array(
-            array(3, '3', 3, '3', 'integer'),
-            array('a', '"a"', 'a', '"a"', 'string'),
-            array($date, 'Jan 1, 2000, 12:00 AM', $date, 'Jan 1, 2000, 12:00 AM', 'DateTime'),
-            array($object, '2', $object, '2', __NAMESPACE__.'\ComparisonTest_Class'),
-        );
+        $comparisons = [
+            [3, '3', 3, '3', 'integer'],
+            ['a', '"a"', 'a', '"a"', 'string'],
+            [$date, 'Jan 1, 2000, 12:00 AM', $date, 'Jan 1, 2000, 12:00 AM', 'DateTime'],
+            [$object, '2', $object, '2', __NAMESPACE__.'\ComparisonTest_Class'],
+        ];
 
         return $comparisons;
     }

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
File Permissions