Review main Merged

55412[TASK] Specific exception in ArrayUtility::getValueByPath()

Christian Kuhn CR +2 V +2 Hard +163 −128 updated 01/19/18, 15:08

Commit message

If ArrayUtility::getValueByPath() does not find a given
path in an array structure, it currently throws a generic
\RuntimeException. Checking the path is one of the key
components of the method and consuming code may not know
if the path exists at all, which is fine.

Throwing global \RuntimeException thus forces various
places to catch \RuntimeException which possibly
hides away programming errors and mis-uses.

The patch makes getValueByPath() throw a specific exception
if path does not exists. Catching that specific exception
reduces the number of global 'catch \RuntimeException'
significantly.

The patch also adds another catch in early install tool
to fix a not recoverable fatal if LocalConfiguration
'EXTENSIONS' array does not yet exist, for instance if
upgrading from v8 to v9.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Frank Nägler +1
    • Mathias Brodala +1
  • Verified V +2
    • Christian Kuhn +2
    • Frank Nägler +1
    • Mathias Brodala +1
    • TYPO3com +1 CI

Issues 2

Files 16

Review log 1826

Show 1 earlier messages
  1. Christian Kuhn uploaded patch set 1 01/19/18, 13:45

  1. Christian Kuhn updated the commit message in patch set 2 01/19/18, 13:48

  2. Mathias Brodala commented on patch set 1 01/19/18, 13:49

    ArrayUtilityGetValueByPathDoesNotExistException.php:23

    How about "MissingArrayPathException"?
  3. TYPO3com voted on patch set 1 V -1 01/19/18, 13:52 Completed build in 07m 01s on Fri, 19 Jan, 02:52 PM Test Summary: 9 of 30351 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18460

  4. TYPO3com voted on patch set 2 V -1 01/19/18, 13:55 Completed build in 06m 26s on Fri, 19 Jan, 02:55 PM Test Summary: 9 of 30351 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18461

  5. Christian Kuhn uploaded patch set 3 01/19/18, 13:55

  6. TYPO3com voted on patch set 3 V -1 01/19/18, 14:03 Completed build in 08m 06s on Fri, 19 Jan, 03:03 PM Test Summary: 9 of 30351 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18462

  7. Christian Kuhn uploaded patch set 4 01/19/18, 14:26

  8. Christian Kuhn uploaded patch set 5 01/19/18, 14:28

  9. Oliver Klee commented on patch set 5 01/19/18, 14:32

    MissingArrayPathException.php:2

    strict, please (so that all new files are strict by default)

    ArrayUtilityTest.php:336

    string type hinting, please
  10. TYPO3com voted on patch set 4 V -1 01/19/18, 14:33 Completed build in 06m 56s on Fri, 19 Jan, 03:33 PM Test Summary: 30193 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18463

  11. TYPO3com voted on patch set 5 V +1 01/19/18, 14:36 Completed build in 08m 24s on Fri, 19 Jan, 03:36 PM Test Summary: 30193 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18464

  12. Christian Kuhn uploaded patch set 6 01/19/18, 14:38

  13. Mathias Brodala commented on patch set 5 01/19/18, 14:40

    ArrayUtility.php:200

    We should mention the path here (implode()'d with $delimiter)
  14. TYPO3com voted on patch set 6 V +1 01/19/18, 14:45 Completed build in 06m 55s on Fri, 19 Jan, 03:45 PM Test Summary: 30193 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18465

  15. Christian Kuhn uploaded patch set 7 01/19/18, 14:46

  16. Christian Kuhn commented on patch set 5 01/19/18, 14:47

    ArrayUtility.php:200 Reply

    Done

    MissingArrayPathException.php:2 Reply

    Done

    ArrayUtilityTest.php:336 Reply

    Done
  17. Frank Nägler voted on patch set 7 V +1 CR +1 01/19/18, 14:55

  18. TYPO3com voted on patch set 7 V +1 01/19/18, 14:55 Completed build in 09m 02s on Fri, 19 Jan, 03:55 PM Test Summary: 30193 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18468

  19. Christian Kuhn uploaded patch set 8 01/19/18, 14:58

  20. Frank Nägler voted on patch set 8 V +1 CR +1 01/19/18, 15:01

  21. Mathias Brodala voted on patch set 8 CR +1 01/19/18, 15:02

  22. TYPO3com voted on patch set 8 V +1 01/19/18, 15:05 Completed build in 06m 33s on Fri, 19 Jan, 04:05 PM Test Summary: 30193 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18469

  23. Mathias Brodala commented on patch set 8 V +1 01/19/18, 15:07

    I believe in Bamboo.
  24. Christian Kuhn voted on patch set 8 V +2 CR +2 01/19/18, 15:08

  25. Christian Kuhn merged patch set 9 01/19/18, 15:08