Breaking: #102632 - Use strict types in Extbase¶
See forge#102632, forge#102878, forge#102879, forge#102885, forge#102954, forge#102956, forge#102966, forge#102969
Description¶
All properties, except the $view
property, in
\TYPO3\
are now strictly typed.
In addition, all function arguments and function return types are now strictly
typed.
Also, the properties in the \TYPO3\
namespace now have native PHP types for their properties.
In summary, the following classes have received strict types:
\TYPO3\
CMS\ Extbase\ Mvc\ Controller\ Action Controller \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Annotation\ Ignore Validation \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Annotation\ ORM\ Cascade \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Annotation\ Required\ Validate \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain Object\ Abstract Domain Object \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain Object\ Domain Object Interface \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain\ Model\ Abstract File Folder \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain\ Model\ Category \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain\ Model\ File Reference \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Domain\ Model\ File \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Generic\ Lazy Object Storage \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Generic\ Persistence Manager \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Generic\ Query Settings Interface \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Generic\ Typo3Query Settings \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Object Storage \TYPO3\
CMS\ Extbase\ TYPO3\ CMS\ Extbase\ Persistence\ Persistence Manager Interface
Impact¶
Classes extending the changed classes must now ensure that overwritten properties and methods are all are strictly typed.
Affected installations¶
Custom classes extending the changed classes.
Migration¶
Ensure classes that extend the changed classes use strict types for overwritten properties, function arguments and return types.
Extensions supporting multiple TYPO3 versions (for example, v12 and v13) must not overwrite properties of the changed classes. Instead, it is recommended to set values of overwritten properties in the constructor of the extending class.
Before¶
<?php
namespace MyVendor\MyExtension\Controller;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class MyController extends ActionController
{
public string $errorMethodName = 'myAction';
}
After¶
<?php
namespace MyVendor\MyExtension\Controller;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class MyController extends ActionController
{
public function __construct()
{
$this->errorMethodName = 'myAction';
}
}