Review main Merged

39257[CLEANUP] Replace deeply nested if structures by guard clauses

Bernhard Kraft CR +2 V +2 Expert +701 −682 updated 05/05/15, 19:28

Commit message

There are some deeply nested if-structures in the versioning
extension, which get replaced with guard clauses with early returns
in this commit.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Markus Klein +1
  • Verified V +2
    • Christian Kuhn +2
    • Markus Klein +1

Issues 1

Files 1

Review log 7

  1. Bernhard Kraft uploaded patch set 1 05/04/15, 13:22

  2. Markus Klein commented on patch set 1 05/04/15, 13:28

    DataHandlerHook.php:714

    cast to (int) and ===

    DataHandlerHook.php:1028

    ; missing

    DataHandlerHook.php:1034

    move the assignment out of the condition

    DataHandlerHook.php:1116

    add cast to (int)

    DataHandlerHook.php:1118

    ===

    DataHandlerHook.php:1371

    if (empty($...))
  3. Bernhard Kraft uploaded patch set 2 05/04/15, 18:24

  4. Bernhard Kraft commented on patch set 2 05/04/15, 18:25

    I ran the units tests after making all changes but didn't test it in a real instance. It wonders me the unit tests didn't find the missing ";"
  5. Markus Klein voted on patch set 2 CR +1 V +1 05/04/15, 21:09

  6. Christian Kuhn commented on patch set 2 CR +2 V +2 05/05/15, 19:28

    thx! btw: this one is very easy to read in gerrit if you "patch set preferences -> ignore whitespaces -> all"
  7. Christian Kuhn merged patch set 2 05/05/15, 19:28