84351[TASK] Use special PHPUnit ruleset for PHPStan
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
Issues 2
Files 12
- Build/phpstan/phpstan.neon+1 −0
- typo3/sysext/core/Tests/Functional/Cache/Backend/ApcuBackendTest.php+1 −1
- typo3/sysext/core/Tests/Functional/Database/Query/QueryBuilder/PositionPlaceholderPreparedStatementTest.php+4 −4
- typo3/sysext/core/Tests/Functional/Security/ContentSecurityPolicy/ModelServiceTest.php+1 −0
- typo3/sysext/core/Tests/Unit/Utility/String/StringFragmentCollectionTest.php+1 −1
- typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php+1 −1
- typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php+1 −1
- typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php+1 −1
- typo3/sysext/form/Tests/Functional/Domain/Model/Renderable/AbstractRenderableTest.php+2 −2
- typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php+1 −1
- typo3/sysext/redirects/Tests/Functional/EventListener/AddPageTypeZeroSourceTest.php+3 −3
- typo3/sysext/redirects/Tests/Unit/RedirectUpdate/RedirectSourceCollectionTest.php+1 −1
Review log 2125
-
Ayke Halder uploaded patch set 1 05/22/24, 22:17
-
core-ci voted on patch set 1 V +1 05/22/24, 22:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58072
-
Anja Leichsenring commented on patch set 1 CR +1 V +1 05/23/24, 04:58
I like, thank you. -
Christian Kuhn commented on patch set 1 05/23/24, 07:18
did you check all places where ->count() is substituted with assertCount() actually works on objects that implement \Countable?IntegrityServiceTest.php:249this should be turned around along the way, shouldn't it? expectation first, then subject value? -
Oliver Klee commented on patch set 1 V +1 05/23/24, 09:59
Very nice! (And yes, what Lolli says.) -
Stefan Bürk commented on patch set 1 05/23/24, 21:43
Please use three normal points instead of these three-dot char, replacing ``` `…` => `...` ``` on the places in the commit message.main has doctrine/dbal 4.x required as minumum, and in TYPO3 v12 we are on doctrine/dbal 3.7.x, thus being higher than the 2.11.0 mentioned here - so that does not explain the need for the baseline. What do I miss here ? -
Stefan Bürk commented on patch set 1 05/26/24, 21:57
Reply
You related to the conditional mocking in the test case, as far as I could tell. I created a dedicated pre-patch to resolve this, after that got merged this commit statement could be removed along with the baseline entry, I guess. See: I4cc2d5942149f69e044c25379c82388f1c4b9f45 -
Benjamin Franzke commented on patch set 1 05/27/24, 06:34
Reply
Why? The unicode ellipsis `…` indicates an intentional omission of text. The three ascii dots `...` would be real code that creates a callable. The omission of text was the intention. I think that's fine. Agreed? -
Ayke Halder uploaded patch set 2
CR +1V +105/27/24, 06:36 -
core-ci voted on patch set 2 V -1 05/27/24, 06:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58323
-
Ayke Halder commented on patch set 2 05/27/24, 06:46
Reply
PHPStan tells to substitute with `assertCount()` on objects that implement `\Countable`. PHPStan `assertCount()` is implemented like this: ``` final public static function assertCount(int $expectedCount, Countable|iterable $haystack, string $message = ''): void { if ($haystack instanceof Generator) { throw GeneratorNotSupportedException::fromParameterName('$haystack'); } static::assertThat( $haystack, new Count($expectedCount), $message, ); } ``` No errors after replacement and does work.Reply
Just quoted the whole messsage now - including variable names.Reply
That was my intention. Patch is blocked by I4cc2d5942149f69e044c25379c82388f1c4b9f45 and can be merged after that.IntegrityServiceTest.php:249ReplyReverted. -
Ayke Halder rebased onto patch set 3
V -105/27/24, 10:40 -
core-ci voted on patch set 3 V +1 05/27/24, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58336
-
Oliver Klee voted on patch set 3 CR +1 V +1 05/27/24, 10:50
-
Christian Kuhn commented on patch set 3 05/27/24, 12:38
Reply
Done -
Christian Kuhn voted on patch set 3 CR +1 V +1 05/27/24, 12:39
-
Christian Kuhn voted on patch set 3 CR 0 V 0 05/27/24, 12:40
-
Christian Kuhn updated the commit message in patch set 4
CR +1V +105/27/24, 12:41 -
Christian Kuhn rebased onto patch set 5 05/27/24, 12:41
-
Christian Kuhn commented on patch set 5 CR +1 V +1 05/27/24, 12:42
removed v12 from releases since the patch gives headaches with some v12 tests that have been cleaned up in main. i guess that's fine: 99% patches are main-first, we don't loose much not enabling this in v12. -
Oliver Klee voted on patch set 5 CR +1 V +1 05/27/24, 12:42
-
Christian Kuhn commented on patch set 5 05/27/24, 12:44
note: good cleanup and good addition to regular code integrity checks. -
Stefan Bürk voted on patch set 5 CR +2 V +2 05/27/24, 12:44
-
Stefan Bürk merged patch set 6 05/27/24, 12:44
-
core-ci voted on patch set 5 V +1 05/27/24, 12:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58346