Project

General

Profile

Actions

Bug #94305

closed

AbstractDomainObject::getUid() has wrong PHPDOC

Added by Armin Vieweg over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-06-10
Due date:
% Done:

100%

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

Description

The current master, but also earlier TYPO3 versions, have an incorrect PHPDOC for the getUid() method of each persisted Extbase entity.

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php#L72

This is the annotation:

@return int the uid or NULL if none set yet.

For code tools (like Rector), this looks like the method will return integer always. But it may also returns null (for new entities). This may lead to unwanted refactorings.
Espeacially in older TYPO3 version, which have no (correct) return type hinting set. There the PHPDOC is the only truth.

Still, PHPDOC and return type hinting does not match.

Actions

Also available in: Atom PDF