Review main Merged

86465[TASK] Resolve all phpstan errors in CorrelationId

Benjamin Franzke CR +2 V +2 Easy +8 −13 updated 10/08/24, 11:18

Commit message

The aspects array-key is always set because the
capture is not nested and filled in any case.
That means: If preg_match was successfull
(which is checked before), aspects have been found as well.

Executed commands:

  composer require --dev phpstan/phpstan:^1.12.6
  Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1519

  1. Benjamin Franzke uploaded patch set 1 10/08/24, 02:22

  2. core-ci voted on patch set 1 V -1 10/08/24, 02:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67295

  3. Benjamin Franzke uploaded patch set 2 V -1 10/08/24, 02:33

  4. core-ci voted on patch set 2 V -1 10/08/24, 02:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67297

  5. Benjamin Franzke uploaded patch set 3 V -1 10/08/24, 02:49

  6. Benjamin Franzke voted on patch set 3 CR -2 10/08/24, 02:49

  7. core-ci voted on patch set 3 V +1 10/08/24, 02:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67300

  8. Markus Klein commented on patch set 3 10/08/24, 06:35

    I'm not sure whether this is really correct. `aspects` are optional in the string to check and hence will always be set, but may be `''`. The former baseline checked for "non-falsy-string", which is wrong to my understanding. So maybe there was a change in phpstan which corrected this type to "non-empty-string"? will check that.
  9. Markus Klein commented on patch set 3 CR +1 V +1 10/08/24, 06:40

    Reply

    Obviously they corrected that type. Good.
  10. Markus Klein commented on patch set 3 10/08/24, 06:41

    CorrelationId.php:63

    could be simplified now to `$aspects = explode('/', ltrim($matches['aspects'], '/'));`
  11. Benjamin Franzke commented on patch set 3 10/08/24, 06:43

    Reply

    yes, they did and because we didn't raise phpstan the error reoccured.
  12. Benjamin Franzke commented on patch set 3 10/08/24, 07:43

    CorrelationId.php:63 Reply

    No, would end up as `['']`. (we could use `trimExplode(…, true)` if we'd really want to)
  13. Stefan Bürk voted on patch set 3 CR +1 V +1 10/08/24, 08:07

  14. Benjamin Franzke uploaded patch set 4 CR +1 V +1 10/08/24, 10:29

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  15. core-ci voted on patch set 4 V +1 10/08/24, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67364

  16. Stefan Bürk voted on patch set 4 CR +1 V +1 10/08/24, 11:17

  17. Christian Kuhn voted on patch set 4 CR +1 V +1 10/08/24, 11:17

  18. Stefan Bürk voted on patch set 4 CR +2 V +2 10/08/24, 11:18

  19. Stefan Bürk merged patch set 5 10/08/24, 11:18