Bug #54021

Cleanup convertParameterReflectionToArray()

Added by Michiel Roos about 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
Start date:
2013-11-27
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

ReflectionService::convertParameterReflectionToArray() builds an array like so:

$parameterInformation = array(
'position' => $parameterPosition,
'byReference' => $parameter->isPassedByReference() ? TRUE : FALSE,
'array' => $parameter->isArray() ? TRUE : FALSE,
'optional' => $parameter->isOptional() ? TRUE : FALSE,
'allowsNull' => $parameter->allowsNull() ? TRUE : FALSE
);

The functions all return Boolean values and do not need to be tested for boaleanness again:

$parameterInformation = array(
'position' => $parameterPosition,
'byReference' => $parameter->isPassedByReference(),
'array' => $parameter->isArray(),
'optional' => $parameter->isOptional(),
'allowsNull' => $parameter->allowsNull()
);

Associated revisions

Revision c0baab82 (diff)
Added by Michiel Roos almost 6 years ago

[TASK] Cleanup convertParameterReflectionToArray()

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

History

#1 Updated by Gerrit Code Review about 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25717

#2 Updated by Gerrit Code Review about 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25717

#3 Updated by Michiel Roos almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF