Skip to content
Snippets Groups Projects
typo3

typo3

Project ID: 81
user avatar
Benni Mack authored
This change aims for
- adding types to objects throughout FAL
- solving some weird issues due to wrong type-hinting
and wrong return types.

Some major public API entry points such as
- getFileObject()
- getFileReferenceObject()
- getResourceFromCombinedIdentifier()

are softened to allow string|int as argument
to ensure maximum backwards-compatibility for
regular extension developers.

All of the existing changes were obvious because most of
the code was already returning the correct values, or used
in the right way -  no code outside of FAL was needed
to be adjusted which makes this change less intrusive.

Some quirks found while sorting out the API:

Apparently some methods in ResourceStorage such
as createFile() etc. should return a File, but _could_ return
File|ProcessedFile|null, which is wrong, but are
now clearly stated.

FolderInterface explicitly mentions "Folder" asa return type
whereas the interface should be strict and not follow any other
implementations when returning code. In general, extending
the FolderInterface and type-hinting FolderInterface everywhere
should be one of the next steps (see comments in FolderInterface).

Some methods within AbstractFile do belong to the actual "File"
object. Some methods within FileInterface should be removed, this is
done in a followup patch and marked as such.

Resolves: #106427
Releases: main
Change-Id: I81ca57bc90308a0557700056010d01a17faadca8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88687


Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
16c2bf66
History
Name Last commit Last update