[TASK] Cleanup convertParameterReflectionToArray() 17/25717/3
authorMichiel Roos <michiel@maxserv.nl>
Wed, 27 Nov 2013 20:12:02 +0000 (21:12 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sat, 4 Jan 2014 16:41:41 +0000 (17:41 +0100)
ReflectionService::convertParameterReflectionToArray() checks
functions already returning boolean again for boolean value.

Remove this overhead and improve readability.

Change-Id: I113f16cd73c713da5ec75b0e57eeee1d0e17308c
Resolves: #54021
Releases: 6.2
Reviewed-on: https://review.typo3.org/25717
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/extbase/Classes/Reflection/ReflectionService.php

index 6737528..2869380 100644 (file)
@@ -472,10 +472,10 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
        protected function convertParameterReflectionToArray(\ReflectionParameter $parameter, $parameterPosition, \ReflectionMethod $method = NULL) {
                $parameterInformation = array(
                        'position' => $parameterPosition,
-                       'byReference' => $parameter->isPassedByReference() ? TRUE : FALSE,
-                       'array' => $parameter->isArray() ? TRUE : FALSE,
-                       'optional' => $parameter->isOptional() ? TRUE : FALSE,
-                       'allowsNull' => $parameter->allowsNull() ? TRUE : FALSE
+                       'byReference' => $parameter->isPassedByReference(),
+                       'array' => $parameter->isArray(),
+                       'optional' => $parameter->isOptional(),
+                       'allowsNull' => $parameter->allowsNull()
                );
                $parameterClass = $parameter->getClass();
                $parameterInformation['class'] = $parameterClass !== NULL ? $parameterClass->getName() : NULL;