79883[!!!][TASK] Introduce type declarations in FileInterface
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Christian Kuhn +1
-
Verified V +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 8
- Build/phpstan/phpstan-baseline.neon+0 −30
- typo3/sysext/core/Classes/Resource/AbstractFile.php18+29 −42
- typo3/sysext/core/Classes/Resource/File.php14+13 −19
- typo3/sysext/core/Classes/Resource/FileInterface.php19+28 −44
- typo3/sysext/core/Classes/Resource/FileReference.php4+30 −39
- typo3/sysext/core/Classes/Resource/ProcessedFile.php2+12 −16
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-101294-IntroduceTypeDeclarationsInFileInterface.rstnew+45 −0
- typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php+2 −0
Review log 4251
Show 2126 earlier messages
-
Alexander Schnitzler uploaded patch set 1 07/09/23, 06:45
-
Alexander Schnitzler wrote 07/09/23, 06:45
Topic set to FAL -
core-ci voted on patch set 1 V -1 07/09/23, 06:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43952
-
Alexander Schnitzler uploaded patch set 2
V -107/09/23, 07:01 -
Alexander Schnitzler marked it ready for review 07/09/23, 07:01
-
Alexander Schnitzler uploaded patch set 3 07/09/23, 07:08
-
core-ci voted on patch set 2 V +1 07/09/23, 07:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43953
-
core-ci voted on patch set 3 V +1 07/09/23, 07:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43954
-
Oliver Klee commented on patch set 3 07/09/23, 08:34
I propose that while we’re having a breaking change for these classes/interfaces anyway, we add the other missing type declarations there as well.AbstractFile.php:136Can we add a native `array` return type declaration here?AbstractFile.php:177Shorter: `?int`AbstractFile.php:408Can we add a native `: self` return type declaration here?AbstractFile.php:422Can we add a native `: self` return type declaration here?AbstractFile.php:434`: string`AbstractFile.php:465`: void`AbstractFile.php:475`: bool`AbstractFile.php:541Shorter: `?string`File.php:157`: void`File.php:225`@return non-empty-string` and `: string`File.php:241Can we add a return type declaration here?File.php:284`: bool`File.php:292`: void`File.php:304`?string`File.php:317`: mixed`FileInterface.php:45`?int`FileInterface.php:64`?string`FileInterface.php:97`@return $this`FileInterface.php:126`?string` -
Oliver Klee voted on patch set 3 V +1 07/09/23, 08:47
-
Alexander Schnitzler commented on patch set 3 07/09/23, 16:32
Reply
If that doesn't widen the scope too much, I am ok with it. I try to keep patch sets smalls however in case of needed reverts. I wouldn't have a problem with another breaking change and a breaking.rst file. Probably there is one huge file for such signature changes anyway, isn't there? -
Oliver Klee commented on patch set 3 07/10/23, 21:40
Reply
Then let's have two breaking changes to keep both changes a bit smaller. -
Alexander Schnitzler commented on patch set 3 07/11/23, 05:36
AbstractFile.php:136ReplyDoneAbstractFile.php:408ReplyDoneAbstractFile.php:422ReplyDoneAbstractFile.php:434ReplyDoneAbstractFile.php:465ReplyDoneAbstractFile.php:475ReplyDoneAbstractFile.php:541ReplyDoneFile.php:157ReplyDoneFile.php:225ReplyDoneFile.php:241ReplyDoneFile.php:284ReplyDoneFile.php:292ReplyDoneFile.php:317ReplyDone -
Alexander Schnitzler commented on patch set 4
V +107/11/23, 06:23Published edit on patch set 3. -
Alexander Schnitzler commented on patch set 4 07/11/23, 06:24
AbstractFile.php:177ReplyDoneFile.php:304ReplyDoneFileInterface.php:45ReplyDoneFileInterface.php:64ReplyDoneFileInterface.php:97ReplyDoneFileInterface.php:126ReplyDone -
core-ci voted on patch set 4 V +1 07/11/23, 06:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44002
-
Oliver Klee voted on patch set 4 V +1 07/11/23, 06:33
-
Oliver Klee commented on patch set 4 07/11/23, 06:37
AbstractFile.php:541`?string`FileReference.php:252`non-empty-string`FileReference.php:418`?string`ProcessedFile.php:588`?string` -
Oliver Klee commented on patch set 4 CR -1 07/11/23, 06:37
on it -
Oliver Klee commented on patch set 5
CR -1V +107/11/23, 06:40Published edit on patch set 4. -
Oliver Klee commented on patch set 5 V +1 CR +1 07/11/23, 06:40
AbstractFile.php:541ReplyDoneFileReference.php:252ReplyDoneFileReference.php:418ReplyDoneProcessedFile.php:588ReplyDone -
core-ci voted on patch set 5 V +1 07/11/23, 06:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44003
-
Stefan Bürk commented on patch set 5 07/11/23, 14:24
FileInterface.php:45Why the nullable int return type ? Should this not be `: int` only like the docblock before ? -
Alexander Schnitzler commented on patch set 5 07/11/23, 14:33
FileInterface.php:45ReplyThat's because of the actual implementation in AbstractFile, which violates the interface and returns null. I am open to change the implementation to return a 0 instead of null or throw an Exception. I guess the least harmful would be to return 0. Since we have a breaking change already, we can simply change this as well. -
Alexander Schnitzler commented on patch set 5 CR -1 07/11/23, 14:43
-1 until issues are resolved. -
Oliver Klee commented on patch set 5 07/11/23, 14:44
FileInterface.php:45ReplyI propose we move this to a pre-patch then. (I wouldn't expect this kind of behavior change in a commit with the title of this change here.)
-
Alexander Schnitzler uploaded patch set 6
CR +1V +107/18/23, 12:09 -
Alexander Schnitzler commented on patch set 6 07/18/23, 12:10
FileInterface.php:45ReplyLet's handle this here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80002 -
Alexander Schnitzler commented on patch set 6 07/18/23, 12:10
Reply
Done -
Oliver Klee voted on patch set 6 CR +1 07/18/23, 12:11
-
core-ci voted on patch set 6 V +1 07/18/23, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44247
-
Oliver Klee voted on patch set 6 V +1 07/18/23, 12:17
-
Oliver Klee updated the commit message in patch set 7
CR +1V +107/18/23, 12:18 -
Oliver Klee voted on patch set 7 V +1 CR +1 07/18/23, 12:18
-
core-ci voted on patch set 7 V +1 07/18/23, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44248
-
Christian Kuhn commented on patch set 7 07/18/23, 12:28
FileInterface.php:69it seems getExtension() implementations return string and not ?string. do we need ?string here, or could we switch to string only? hope this hasn't been discussed, yet ... -
Alexander Schnitzler commented on patch set 7 07/18/23, 12:32
FileInterface.php:69ReplyHasn't been discussed yet but my argument would be that there are files without extension. Absence of extension is expressed by null. I would also consider changing the implementation but in another patch a dedicated breaking rst. -
Christian Kuhn commented on patch set 7 07/18/23, 12:33
FileInterface.php:69ReplyAck -
Christian Kuhn commented on patch set 7 07/18/23, 12:36
FileInterface.php:69Replyactually ... empty extension could also return empty string, cloudn't it? that's logically fine as well, i guess? unsure ... -
Alexander Schnitzler commented on patch set 7 07/18/23, 12:43
FileInterface.php:69ReplyI am open to different views and approaches. I personally like showing the absence of a file extension by null better than having an empty string because then different behavior means different types. As a caller I'd rather want to see null|non-empty-string than checking the string for it's length. But if others think it's more convenient that way, I am fine either way. -
Alexander Schnitzler commented on patch set 7 07/18/23, 12:52
FileInterface.php:69ReplyAfter thinking about it: Let's change it back to string. java and .net also just use empty strings, our implementation uses strings only, all internal callers expect a string. Will be easier for everyone. -
Alexander Schnitzler uploaded patch set 8
CR +1V +107/18/23, 12:56 -
core-ci voted on patch set 8 V +1 07/18/23, 13:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44251
-
Alexander Schnitzler commented on patch set 8 07/18/23, 14:18
FileInterface.php:69ReplyDone -
Oliver Klee voted on patch set 8 V +1 CR +1 07/18/23, 14:36
-
Christian Kuhn uploaded patch set 9
CR +1V +107/19/23, 05:57 -
Christian Kuhn voted on patch set 9 V +1 CR +1 07/19/23, 05:57
-
core-ci voted on patch set 9 V +1 07/19/23, 06:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44289
-
Oliver Klee voted on patch set 9 V +1 CR +1 07/19/23, 07:54
-
Stefan Bürk voted on patch set 9 V +2 CR +2 07/19/23, 08:16
-
Stefan Bürk merged patch set 10 07/19/23, 08:16