80770[TASK] Add PHPStan type hints in PackageManager
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oliver Klee +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- core-ci +1 CI
Issues 1
Files 3
Review log 810
-
Oliver Hader uploaded patch set 1 08/31/23, 10:23
-
Andreas Kienast commented on patch set 1 08/31/23, 10:27
-
core-ci voted on patch set 1 V -1 08/31/23, 10:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46080
-
Oliver Klee commented on patch set 1 08/31/23, 10:44
PackageManager.php:47Those two probably can be `non-empty-string`.PackageManager.php:49Also `non-empty-string`?PackageManager.php:64Can any of these be `non-empty-string`?PackageManager.php:450At least PHPStan will reduce these two to `string` (as the other two types are subtypes of `string`). So having this would only make sense for the benefit of the reader, but not for the benefit of PHPStan. Ditto for all other places where we have `string|Package*`.ImportMapFactory.php:37Is this change (the added `array_values`) intended to be part of this change (which is about introducing more specific type annotations)? It rather looks like a change of behavior to me.DependencyOrderingService.php:94Both `mixed` should `array-key` (as they cannot be any other type than `string` or `int`).DependencyOrderingService.php:103We'll also need to update this type annotation to match the return type annotation. -
Oliver Hader uploaded patch set 2
V -108/31/23, 11:32 -
Oliver Hader commented on patch set 2 08/31/23, 11:32
PackageManager.php:47ReplyDonePackageManager.php:49ReplyDonePackageManager.php:64ReplyDonePackageManager.php:450ReplyPhpStorm was complaining. That's why I used it like that.PackageManager.php:624ReplyYepp, I was missing it in the other patch... ;)ImportMapFactory.php:37ReplyNope. `ImportMap` constructor is declared like the following: ``` @param list<PackageInterface> $packages ``` Internally in `ImportMap` the array keys are not used.DependencyOrderingService.php:94ReplyPHPStan failed when using `string|int` explicitly - seems to work with `array-key`.DependencyOrderingService.php:103ReplyThere are other occurrence in that class which one could adjust later... -
core-ci voted on patch set 2 V +1 08/31/23, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46089
-
Oliver Klee voted on patch set 2 V +1 CR +1 08/31/23, 11:46
-
Christian Kuhn voted on patch set 2 V +2 CR +2 08/31/23, 13:37
-
Christian Kuhn merged patch set 3 08/31/23, 13:37
PackageManager.php:624