[TASK] Replace array_push with normal array assignment 45/57245/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 17 Jun 2018 14:39:05 +0000 (16:39 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 18 Jun 2018 04:40:33 +0000 (06:40 +0200)
Direct array assignment works faster than invoking php functions

Resolves: #85290
Releases: master
Change-Id: I607b11ddd96114e14a04988887f3b3139d4ae06a
Reviewed-on: https://review.typo3.org/57245
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php

index 048e049..01ea46e 100644 (file)
@@ -561,11 +561,11 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface
                 $parsedAnnotations = $this->parseValidatorAnnotation($validateValue);
 
                 foreach ($parsedAnnotations['validators'] as $validator) {
-                    array_push($validateAnnotations, [
+                    $validateAnnotations[] = [
                         'argumentName' => $parsedAnnotations['argumentName'],
                         'validatorName' => $validator['validatorName'],
                         'validatorOptions' => $validator['validatorOptions']
-                    ]);
+                    ];
                 }
             }
         }