Review 12.4 Merged

82232[BUGFIX] Avoid type errors in `ResourceFactory` methods

Stefan Bürk CR +2 V +2 Easy +17 −19 updated 12/19/23, 05:35

Commit message

With #92289 logic has been decoupled from `ResourceFactory`
into the `StorageRepository`. As a side change, native php
types have been added to a couple of methods.

`StorageRepository->findByUid()` parameter type has been set
to integer, which breaks the `null` fallback and retrieving
the default storage `uid: 0` in `ResourceFactory` method
`getStorageObjectFromCombinedIdentifier()`. Even worse is
the fact that `getObjectFromCombinedIdentifier()` does not
even try to cope with a invalid identifier provided.

This change modifies `getObjectFromCombinedIdentifier()` and
`getStorageObjectFromCombinedIdentifier` of `ResourceFactory`
to cope with missing storage identifier by falling back to
the default storage (`0`) with a shuffle of the exploded values.

As a side-effect two PHPStan ignore patterns can be removed
from the PHPStan baseline file.

Used command(s):

  Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Review

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

Issues 2

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 12/19/23, 05:06

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 12/19/23, 05:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50779

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 12/19/23, 05:34

  4. Stefan Bürk merged patch set 2 12/19/23, 05:35