Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking: #102632 - Use strict types in Extbase #4074

Closed
simonschaufi opened this issue Feb 12, 2024 · 0 comments · Fixed by #4151 or #4160
Closed

Breaking: #102632 - Use strict types in Extbase #4074

simonschaufi opened this issue Feb 12, 2024 · 0 comments · Fixed by #4151 or #4160

Comments

@simonschaufi
Copy link
Collaborator

simonschaufi commented Feb 12, 2024

Breaking: #102632 - Use strict types in Extbase

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-102632-UseStrictTypesInExtbase.html

Breaking: #102632 - Use strict types in Extbase

See 102632, 102878, 102879, 102885, 102954, 102956,
102966, 102969

Description

All properties, except the $view property, in
\TYPO3\CMS\Extbase\Mvc\Controller\ActionController are now strictly
typed. In addition, all function arguments and function return types are
now strictly typed.

Also, the properties in the \TYPO3\CMS\Extbase\Annotation\Annotation
namespace now have native PHP types for their properties.

In summary, the following classes have received strict types:

  • \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Annotation\IgnoreValidation
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Annotation\ORM\Cascade
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Annotation\Required\Validate
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Domain\Model\Category
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Domain\Model\FileReference
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Domain\Model\File
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\ObjectStorage
  • \TYPO3\CMS\Extbase\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface

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';
    }
}

Backend, Frontend, NotScanned, ext:extbase

@sabbelasichon sabbelasichon self-assigned this Feb 14, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
126016 added a commit that referenced this issue Mar 7, 2024
126016 added a commit that referenced this issue Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
126016 added a commit that referenced this issue Mar 7, 2024
@simonschaufi simonschaufi added this to the Code Sprint 03.2024 milestone Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
simonschaufi added a commit that referenced this issue Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment