[TASK] Deprecate extbase StopActionException
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Deprecation-94351-ExtextbaseStopActionException.rst
1 .. include:: ../../Includes.txt
2
3 =====================================================
4 Deprecation: #94351 - ext:extbase StopActionException
5 =====================================================
6
7 See :issue:`94351`
8
9 Description
10 ===========
11
12 To further prepare towards clean PSR-7 Request / Response handling in
13 extbase, the extbase internal :php:`TYPO3\CMS\Extbase\Mvc\Exception\StopActionException`
14 has been deprecated.
15
16
17 Impact
18 ======
19
20 No deprecation is logged, but the :php:`StopActionException` will be
21 removed in v12 as breaking change. Extension developers with extbase
22 based controllers can prepare in v11 towards this.
23
24
25 Affected Installations
26 ======================
27
28 Extensions with extbase controllers that throw :php:`StopActionException` or
29 use methods :php:`redirect` or :php:`redirectToUri` from extbase :php:`ActionController`
30 are affected.
31
32
33 Migration
34 =========
35
36 As a goal, extbase actions will *always* return a :php:`ResponseInterface`
37 in v12. v11 prepares towards this, but still throws the :php:`StopActionException`
38 in :php:`redirectToUri`. Developers should prepare towards this, however.
39
40 Example before:
41
42 .. code-block:: php
43
44 public function fooAction()
45 {
46 $this->redirect('otherAction');
47 }
48
49 Example compatible with v10, v11 and v12 - IDE's and static code analyzers
50 may complain in v10 and v11, though:
51
52 .. code-block:: php
53
54 public function fooAction(): ResponseInterface
55 {
56 // A return is added!
57 return $this->redirect('otherAction');
58 }
59
60 .. index:: PHP-API, NotScanned, ext:extbase