81885[!!!][TASK] Use strict types in Extbase ActionController
Commit message
Review
-
Code review CR +2 Done
- Oliver Hader +2
- Oliver Klee +1
- Nikita Hovratov +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Oliver Hader +2
- Oliver Klee +1
- Nikita Hovratov +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 10
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102632-UseStrictTypesInExtbaseActionController.rst5new+78 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield/Classes/Controller/ContentController.php+1 −5
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield/Classes/Controller/QueueController.php+1 −5
- typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php17+102 −152
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Controller/BlogController.php+1 −5
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Controller/ContentController.php+1 −5
- typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/Extension/action_controller_test/Classes/Controller/TestController.php+2 −2
- typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php+1 −4
- typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php+1 −4
- typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php+1 −1
Review log 3847
Show 1722 earlier messages
-
Torben Hansen uploaded patch set 1 11/23/23, 08:48
-
core-ci voted on patch set 1 V +1 11/23/23, 08:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49612
-
Andreas Wolf commented on patch set 1 11/23/23, 10:35
-
Torben Hansen uploaded patch set 2
V +112/07/23, 18:14 -
Torben Hansen commented on patch set 2 12/07/23, 18:14
ActionController.php:91ReplyDone -
core-ci voted on patch set 2 V +1 12/07/23, 18:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50464
-
Torben Hansen uploaded patch set 3
V +112/08/23, 14:17 -
Torben Hansen wrote 12/08/23, 14:18
Topic set to extbase -
Torben Hansen updated the commit message in patch set 4 12/08/23, 14:18
-
core-ci voted on patch set 3 V +1 12/08/23, 14:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50503
-
core-ci voted on patch set 4 V +1 12/08/23, 14:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50504
-
Oliver Klee voted on patch set 4 V +1 12/08/23, 15:05
-
Oliver Klee commented on patch set 4 12/08/23, 15:08
ActionController.php:99Would it make sense to annotate this as `@var non-empty-string`?ActionController.php:692Should we type this as well, e.g., as `mixed`? -
Oliver Klee commented on patch set 4 12/11/23, 21:18
ActionController.php:692Reply(The stand-alone type `null` (which would have been the most fitting type AFAICT) is unfortunately only available in PHP 8.2 and later, it seems: https://www.php.net/manual/en/language.types.declarations.php) -
Simon Schaufelberger commented on patch set 4 12/15/23, 00:02
why is the view property excluded. please explain. -
Torben Hansen uploaded patch set 5
V +112/15/23, 11:04 -
Torben Hansen commented on patch set 4 12/15/23, 11:04
Reply
The `view` property is excluded here, since if this variable would be type safe, then all classes extending `ActionController` have to use `ViewInterface` as type for this variable. As an example, the `TYPO3\CMS\Extensionmanager\Controller\DownloadController` uses `JsonView` as type annotation and if we have strict types for the `view` property, we have to use both the PHP type declaration for the property and the `@var` annotation. Basically I'm open to make this property strict too, as the change is breaking. If someone sees a benefit in this, I can change the patch.ActionController.php:99ReplyDoneActionController.php:692ReplyDone -
core-ci voted on patch set 5 V +1 12/15/23, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50682
-
Oliver Klee voted on patch set 5 CR +1 V +1 12/16/23, 10:49
-
Christian Kuhn commented on patch set 5 12/18/23, 10:54
Reply
the view class has to change later anyways. keep it non-typed for now, please. -
Christian Kuhn commented on patch set 5 CR -1 12/18/23, 10:59
Breaking-102632-UseStrictTypesInExtbaseActionController.rst:37The problem is here that extensions which want to stay compatatible with v12 & v13 need a quirk here: properties in PHP are liskov co- *and* contravariant. That means, when an inheriting class sets the property to something different, it will either crash v12 (if type hint is there), or v13 (if type hint is *not* there). The only solution for extensions that aim for both v12&v13 compat is to *not* override the property, but instead set the wanted value in __construct(). This migration path should be documented here. -
Christian Kuhn commented on patch set 5 12/18/23, 11:00
Breaking-102632-UseStrictTypesInExtbaseActionController.rst:37Replynote this is a general strategy for other places where core delivers an abstract and wants to add types on properties that might have custom values in inheritance.
-
Torben Hansen uploaded patch set 6
CR +1V +112/21/23, 07:53 -
Torben Hansen commented on patch set 6 12/21/23, 07:54
Breaking-102632-UseStrictTypesInExtbaseActionController.rst:37ReplyDone -
core-ci voted on patch set 6 V +1 12/21/23, 08:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50859
-
Oliver Klee voted on patch set 6 CR +1 V +1 12/21/23, 10:49
-
Nikita Hovratov commented on patch set 6 CR -1 12/21/23, 12:00
Breaking-102632-UseStrictTypesInExtbaseActionController.rst:60One "-" too muchActionController.php:742Return type must be `never` here, as the exception is always thrown. -
Torben Hansen uploaded patch set 7
CR +1V +112/21/23, 12:37 -
Torben Hansen commented on patch set 7 12/21/23, 12:37
Breaking-102632-UseStrictTypesInExtbaseActionController.rst:60ReplyDoneActionController.php:742ReplyThanks, did not know that. -
core-ci voted on patch set 7 V +1 12/21/23, 12:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50865
-
Oliver Klee voted on patch set 7 CR +1 V +1 12/21/23, 12:53
-
Nikita Hovratov voted on patch set 7 CR +1 12/21/23, 13:27
-
Nikita Hovratov uploaded patch set 8
CR +1V +112/21/23, 19:42 -
Nikita Hovratov commented on patch set 8 12/21/23, 19:47
ActionController.php:717This looks odd. Maybe this should be string? Or UriInterface|string ? -
core-ci voted on patch set 8 V +1 12/21/23, 19:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50876
-
Oliver Klee commented on patch set 8 V +1 12/21/23, 20:10
ActionController.php:693I'd suggest (for the sake of completeness) to also type `$_`, e.g., as `mixed`.ActionController.php:717Also, I'd suggest (for the sake of completeness) to also type `$_`, e.g., as `mixed`. -
Nikita Hovratov commented on patch set 8 12/21/23, 20:16
ActionController.php:693ReplyI don't know, it is hinted as `null` in the doc block param. `mixed` would allow the old value `int` and would not warn the user that this value is deprecated.ActionController.php:717ReplySame as comment above. -
Oliver Klee commented on patch set 8 12/21/23, 20:44
ActionController.php:693ReplyAh, and we already have the PHPDoc type annotation `null`. Then let's keep it as is.ActionController.php:717ReplyAck. -
Torben Hansen uploaded patch set 9
V +101/05/24, 10:20 -
Torben Hansen commented on patch set 8 01/05/24, 10:20
ActionController.php:717Replydone -
core-ci voted on patch set 9 V +1 01/05/24, 10:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51133
-
Oliver Klee voted on patch set 9 CR +1 V +1 01/05/24, 11:01
-
Simon Schaufelberger voted on patch set 9 CR +1 V +1 01/05/24, 12:07
-
Nikita Hovratov voted on patch set 9 CR +1 V +1 01/08/24, 10:02
-
Oliver Hader voted on patch set 9 CR +1 V +1 01/24/24, 12:39
-
Oliver Hader voted on patch set 9 CR +2 V +2 01/24/24, 12:41
-
Oliver Hader merged patch set 10 01/24/24, 12:41
ActionController.php:91