[BUGFIX] Correct return type for FileReference methods
authorChris Müller <typo3@krue.ml>
Mon, 17 May 2021 06:57:38 +0000 (08:57 +0200)
committerRichard Haeser <richard@richardhaeser.com>
Mon, 17 May 2021 07:26:00 +0000 (09:26 +0200)
commit023864e38b13ff097c0ead58a91667037e233904
treee2c05f5e1dcb14ebc04d48343ea3f604c1912e93
parentb50d8a7f033b53ec0da81be6bb9700122c087f97
[BUGFIX] Correct return type for FileReference methods

The @return annotation for the following FileReference methods is set
to "string", but these methods can also return null:

- getTitle()
- getAlternative()
- getDescription()

To avoid problems with code quality tools and to ensure type
safety the return value of these methods is always casted to a
string.

Resolves: #94144
Releases: master, 10.4
Change-Id: Id28281ca9b55f20fb02e0de3adfe510f88580141
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69155
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Richard Haeser <richard@richardhaeser.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Richard Haeser <richard@richardhaeser.com>
typo3/sysext/core/Classes/Resource/FileReference.php
typo3/sysext/core/Tests/Unit/Resource/FileReferenceTest.php