74644[BUGFIX] Mark nullable properties in EXT:core as such
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- crell +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Stefan Bürk +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 9
- Build/phpstan/phpstan-baseline.neon+0 −50
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+1 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+2 −2
- typo3/sysext/core/Classes/FormProtection/AbstractFormProtection.php+1 −1
- typo3/sysext/core/Classes/Package/Package.php+1 −1
- typo3/sysext/core/Classes/Resource/Processing/AbstractGraphicalTask.php+1 −1
- typo3/sysext/core/Classes/Resource/ResourceStorage.php+1 −1
- typo3/sysext/core/Classes/Routing/Enhancer/AbstractEnhancer.php+1 −1
- typo3/sysext/core/Classes/Routing/UrlGenerator.php5+1 −1
Review log 1113
-
Oliver Klee uploaded patch set 1 05/14/22, 09:45
-
core-ci voted on patch set 1 V +1 05/14/22, 09:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27207
-
Stefan Bürk rebased onto patch set 2 05/16/22, 23:31
-
core-ci voted on patch set 2 V +1 05/16/22, 23:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27273
-
crell voted on patch set 2 CR +1 05/17/22, 16:30
-
Simon Schaufelberger commented on patch set 2 05/22/22, 23:45
-
Stefan Bürk commented on patch set 2 05/23/22, 10:07
UrlGenerator.php:29ReplyWhat if it will not get injected ? Maybe using new for class. So it's correct that it may be null. (Should not, but can be). And as this get not injected through constructor phpstan will not take this as not nullable. (Although construtor may be ommited). -
Oliver Klee commented on patch set 2 05/23/22, 10:47
UrlGenerator.php:29ReplyI'd be fine with both approaches: a) make the property nullable (as with patchset 2) b) remove the null check in line 52 @Stefan: What's your preference? -
Stefan Bürk commented on patch set 2 05/23/22, 11:35
UrlGenerator.php:29ReplyGo with nullable property. Constructor may be discussed to have non-nullable properties, inject methods not. * constructor are called if `new ClassName()` is used intentianlly or by accident * constructor may be avoided in tests (prohpesizing/mocks) - then a hard fail may be okay then (so test setup can be done properly) * setter(inject) methods may be not called, thus property should be nullable and working code should deal with it (that the property may be null) Assuming that the inject would executed everytime before the processing code is a "blind" assumption which is "not guaranteed". Thus avoiding nullable property is wrong in my eyes - and would lead to further miss-assumptions (property is always set etc). -
Oliver Klee commented on patch set 2 05/23/22, 11:39
UrlGenerator.php:29ReplyAck -
Simon Schaufelberger voted on patch set 2 V +1 CR +1 05/23/22, 12:02
-
Stefan Bürk voted on patch set 2 V +2 CR +2 05/28/22, 20:53
-
Stefan Bürk merged patch set 3 05/28/22, 20:53
UrlGenerator.php:29