Review main Merged

28234[TASK] Simplify TYPO3_DB->cleanIntArray

Bernhard Kraft CR +2 V +2 Normal +78 −4 updated 03/18/14, 13:33

Commit message

Instead of iterating over the array and calling "intval" for each
element the "array_map" php function gets used.

Review

  • Code review CR +2
    • Dmitry Dulepov +2
    • Christian Kuhn +2
  • Verified V +2
    • Dmitry Dulepov +2
    • Christian Kuhn +2

Issues 1

Files 2

Review log 11

  1. Mr. Jenkins commented on patch set 1 03/10/14, 17:44

  2. Markus Klein commented on patch set 1 03/10/14, 17:50

    I'm for removing this function. It has only 8 usage. So do the array_map directly there and deprecate the function.
    6.0 is in important bugfix mode, no backport
  3. Oliver Klee commented on patch set 1 03/10/14, 19:03

    I agree.
  4. Bernhard Kraft commented on patch set 1 03/18/14, 08:11

    Maybe we should leave it there. AFAIK calling a method is not that expensive. At least less expensive than iterating over an array with quite some elements. If we would write assembler here (like I do currently: PIC assembler :) I would suggest to let it be a macro. Also stuff which recently became necessary for TYPO3 development. Like: if (isset($variable[$key]) && $variable[$key]) { could get replaced by something like if (ASSERT_KEY($variable, $key)) { ... but sadly there are no macros for PHP. There is a discussion about their usefulness and if they would improve readability/execution/speed: http://bytes.com/topic/php/answers/477779-macros-php I vote for leaving cleanIntArray there. For the sake of readability.
  5. Christian Kuhn commented on patch set 1 03/18/14, 08:24

    could this method please get a couple of simple unit tests to prove behavior is not changed?
  6. Christian Kuhn voted on patch set 1 CR -1 03/18/14, 08:24

  7. Bernhard Kraft uploaded patch set 2 03/18/14, 12:26

  8. Mr. Jenkins commented on patch set 2 03/18/14, 12:58

  9. Dmitry Dulepov commented on patch set 2 V +2 CR +2 03/18/14, 13:11

    Tested, works. Unit tests pass.
  10. Christian Kuhn commented on patch set 2 V +2 CR +2 03/18/14, 13:33

    thx!
  11. Christian Kuhn merged patch set 3 03/18/14, 13:33