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 #1

Updated by Gerrit Code Review over 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/+/69457

Actions #2

Updated by Andreas Fernandez over 3 years ago

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

Updated by Gerrit Code Review over 3 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/+/69435

Actions #4

Updated by Andreas Fernandez over 3 years ago

  • Status changed from Under Review to Resolved
Actions #5

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF