Breaking: #101327 - Harden FileInterface::getSize()

See forge#101327


A return type declaration has been added to the method stub \TYPO3\CMS\Core\Resource\FileInterface::getSize(). As a consequence, implementations of said method, \TYPO3\CMS\Core\Resource\AbstractFile::getSize() and \TYPO3\CMS\Core\Resource\FileReference::getSize() received return type declarations as well.

Also, \TYPO3\CMS\Core\Resource\AbstractFile::getSize() has been adjusted to actually just return an integer. Previously, it returned null, if the actual size could not be gathered. It now returns 0 in that case.


Code, that calls \TYPO3\CMS\Core\Resource\AbstractFile::getSize() through derivatives like \TYPO3\CMS\Core\Resource\File::getSize() might be adjusted to not respect null any more.

Implementations (classes) that implement \TYPO3\CMS\Core\Resource\FileInterface, have to adjust the return type of the method getSize() to match the contract.

Affected installations

Installations that implement \TYPO3\CMS\Core\Resource\FileInterface or that call \TYPO3\CMS\Core\Resource\FileInterface::getSize() via derivatives.


Adjust the return type and possible null checks.