Skip to content

Conversation

@sbuerk
Copy link
Member

@sbuerk sbuerk commented Dec 30, 2025

TYPO3 v11.5 started streamlining the view implementation,
which included deprecating the extbase ViewInterface.
Extensions supporting two TYPO3 core version need to take
care and the migration path for controllers overriding the
initialzeView method is stated in the changelog [1].

This change follows the recommended migration path and
removes the deprecated interface as method native type
declarion for the $view argument, avoiding in TYPO3
v12 the exception

TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException
Class "TYPO3\CMS\Extbase\Mvc\View\ViewInterface" does not exist.
Reflection failed.

while still making required adjustments. We need to
add one error to the TYPO3 v12 phpstan baseline as
the error is not reported in TYPO3 v11 and using the
phpstan-ignore annotation does not work.

Dispatching a callable is slightly modified within
FileFacade, moving the callable array into local
variable first to allow phpstan properly deal with
it. That allows us to remove error pattern ignore
from the baseline instead of recreating it with a
changed message.

On top, a small typo (casing) in runTests.sh is
fixed along the way to write the updated baselines
to the correct paths.

Used command(s):

Build/Scripts/runTests.sh -p 8.1 -t 11 -s phpstanGenerateBaseline && \
Build/Scripts/runTests.sh -p 8.2 -t 12 -s phpstanGenerateBaseline

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.5/Deprecation-95222-ExtbaseViewInterface.html

Resolves: #22

@sbuerk sbuerk force-pushed the bugfix-22-v12viewinterface-deprecation-95222 branch from 8c9875d to 02883f4 Compare December 30, 2025 15:16
TYPO3 v11.5 started streamlining the view implementation,
which included deprecating the extbase `ViewInterface`.
Extensions supporting two TYPO3 core version need to take
care and the migration path for controllers overriding the
`initialzeView` method is stated in the changelog [1].

This change follows the recommended migration path and
removes the deprecated interface as method native type
declarion for the `$view` argument, avoiding in TYPO3
v12 the exception

  TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException
  Class "TYPO3\CMS\Extbase\Mvc\View\ViewInterface" does not exist.
  Reflection failed.

while still making required adjustments. We need to
add one error to the TYPO3 v12 phpstan baseline as
the error is not reported in TYPO3 v11 and using the
`phpstan-ignore` annotation does not work.

Dispatching a callable is slightly modified within
`FileFacade`, moving the callable array into local
variable first to allow phpstan properly deal with
it. That allows us to remove error pattern ignore
from the baseline instead of recreating it with a
changed message.

On top, a small typo (casing) in `runTests.sh` is
fixed along the way to write the updated baselines
to the correct paths.

Used command(s):

```shell
Build/Scripts/runTests.sh -p 8.1 -t 11 -s phpstanGenerateBaseline && \
Build/Scripts/runTests.sh -p 8.2 -t 12 -s phpstanGenerateBaseline
```
[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.5/Deprecation-95222-ExtbaseViewInterface.html

Resolves: #22
@sbuerk sbuerk force-pushed the bugfix-22-v12viewinterface-deprecation-95222 branch from 02883f4 to fa4e63c Compare December 30, 2025 15:43
@sbuerk sbuerk merged commit f76dce7 into master Dec 30, 2025
26 checks passed
@sbuerk sbuerk deleted the bugfix-22-v12viewinterface-deprecation-95222 branch December 30, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not compatible with TYPO3 12

2 participants