78031[TASK] Introduce type declarations for makeInstance()
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Klee +1
- Dmitry Dulepov +1
-
Verified V +2 Done
- Benni Mack +2
- Oliver Klee +1
- Dmitry Dulepov +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2937
Show 812 earlier messages
-
Alexander Schnitzler uploaded patch set 1 03/05/23, 14:48
-
Alexander Schnitzler commented on patch set 1 03/05/23, 14:54
See https://decisions.typo3.org/t/phpstan-specific-phpdoc-annotations-in-the-core-code-base/807 for reference. -
Alexander Schnitzler wrote 03/05/23, 14:54
Topic set to phpstan -
core-ci voted on patch set 1 V -1 03/05/23, 15:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38496
-
Alexander Schnitzler uploaded patch set 2
V -103/06/23, 08:44 -
core-ci voted on patch set 2 V +1 03/06/23, 09:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38520
-
Oliver Klee voted on patch set 2 V +1 CR +1 03/07/23, 12:43
-
Alexander Schnitzler uploaded patch set 3
CR +1V +103/09/23, 09:07 -
Alexander Schnitzler rebased onto patch set 4 03/09/23, 09:07
-
core-ci voted on patch set 3 V -1 03/09/23, 09:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38681
-
core-ci voted on patch set 4 V -1 03/09/23, 09:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38682
-
Alexander Schnitzler uploaded patch set 5
V -103/09/23, 09:19
-
Oliver Klee voted on patch set 5 CR +1 03/09/23, 09:21
-
core-ci voted on patch set 5 V +1 03/09/23, 09:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38683
-
Oliver Klee commented on patch set 5 CR 0 03/09/23, 09:28
GeneralUtility.php:2917We can also have a type declaration for `$constructorArguments`: ``` public static function makeInstance(string $className, mixed ...$constructorArguments): object ``` -
Oliver Klee uploaded patch set 6
V +103/09/23, 09:28 -
Oliver Klee commented on patch set 5 V +1 CR +1 03/09/23, 09:28
GeneralUtility.php:2917ReplyDone -
Oliver Klee voted on patch set 6 V +1 CR +1 03/09/23, 09:28
-
Alexander Schnitzler commented on patch set 6 03/09/23, 09:42
Reply
Done -
core-ci voted on patch set 6 V -1 03/09/23, 09:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38684
-
Oliver Klee uploaded patch set 7
CR +1V +103/09/23, 09:51 -
Oliver Klee voted on patch set 7 V +1 CR +1 03/09/23, 09:52
-
core-ci voted on patch set 7 V +1 03/09/23, 09:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38686
-
Oliver Klee commented on patch set 7 CR -1 03/09/23, 09:59
I'd like to get https://review.typo3.org/c/Packages/TYPO3.CMS/+/78080 merged as a pre-patch first. -
Oliver Klee uploaded patch set 8
CR -1V +103/09/23, 13:13 -
Oliver Klee voted on patch set 8 V +1 CR +1 03/09/23, 13:15
-
core-ci voted on patch set 8 V +1 03/09/23, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38699
-
Nikita Hovratov commented on patch set 8 V -1 03/09/23, 13:24
Not sure, we treated changing return types / parameter types as breaking in the past: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97210-TypesAddedToMethodSignaturesOrClassProperties.rst -
Oliver Klee commented on patch set 8 03/09/23, 13:58
Reply
GeneralUtility is already listed in that ReST. Would it make sense to add another ReST file with similar contents for 12.3.0, or does having it for 12.0 suffice? -
Alexander Schnitzler commented on patch set 8 03/09/23, 14:27
Reply
This is not breaking because the type had been checked before and threw an exception if `$className` was not a string. There is no actual use case where users have a worse experience with a TypeError instead of an \InvalidArgumentException. Let's be pragmatic from time to time ;) -
Nikita Hovratov commented on patch set 8 03/09/23, 16:28
Reply
I don't mean the usage itself, but in (super) rare cases, where people might extend GeneralUtility. Need another opinion on that, but that was our rule for being breaking in early v12 development. -
Alexander Schnitzler commented on patch set 8 03/09/23, 18:16
Reply
To be frank here, this is hilarious. If we respect those edge cases we are nuts. I can't come up with any legit scenario where I extend a static class, overwrite a factory method and exchange the type of `$classString`. To me it's wasted time thinking about it even. API (contract) should be: You pass a class-string, you get an object. That's not violated, hence not breaking. -
Benni Mack commented on patch set 8 03/09/23, 20:05
Reply
X-Classing is not covered by BC, however, there are a few cases (like AbstractPlugin) where I would refrain from such changes. Within a class with static methods like GeneralUtility or ExtensionManagementUtility that already have these checks anyway, I don't see a problem. -
Nikita Hovratov commented on patch set 8 V 0 03/10/23, 08:33
Reply
Ack -
Dmitry Dulepov commented on patch set 8 V +1 CR +1 03/13/23, 11:56
I had this issue with phpstorm: https://forge.typo3.org/issues/100152 Then Georg pointed me to this change and it works fine for me if I change code in v12.2.0 to look like here. -
Benni Mack voted on patch set 8 V +2 CR +2 03/14/23, 20:29
-
Benni Mack merged patch set 9 03/14/23, 20:29