Project

General

Profile

Actions

Bug #94144

closed

Return values of FileReferences getters is null when it should be empty string

Added by Chris Müller almost 3 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2021-05-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In introduced in a project Rector with the code quality rule. In one of my controllers I have the following code:

/* @var FileReference $image */
if ($image->getAlternative()) {
    // do something
}

Rector now changes this condition to:

if ($image->getAlternative() !== '') {
   // do something
}

This is because the @return annotation of the getAlternative() method is set to "string".

But this is not correct as ->getAlternative() can also return null.

The same is with ->getTitle() and ->getDescription().

Actions #1

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69155

Actions #2

Updated by Chris Müller almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70256

Actions #4

Updated by Riccardo De Contardi 10 months ago

  • Status changed from Under Review to Closed

Abandoned for 10.4 -> closing it

If you think that this is the wrong decision or experience the issue again, please reopen it or open a new issue with a reference to this one. Thank you.

Actions

Also available in: Atom PDF