74826[BUGFIX] Tighten a conditional check in LinkService
Commit message
Review
-
Code review CR +2 Done
- Andreas Kienast +2
- Oliver Klee +1
- Benni Mack +1
-
Verified V +2 Done
- Andreas Kienast +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 2
Review log 1012
-
crell uploaded patch set 1 06/07/22, 22:10
-
core-ci voted on patch set 1 V +1 06/07/22, 22:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27782
-
Oliver Klee voted on patch set 1 CR +1 06/07/22, 22:18
-
Benni Mack commented on patch set 1 06/08/22, 16:11
is this a bugfix? -
crell commented on patch set 1 06/08/22, 16:44
Reply
A very small one. It's an incorrect check, because per the docblock $this->handlers is always an array of objects, so the is_object() check is always going to be true. Based on the contents of the else, what it's actually checking for is that the key exists, viz, it's checking for a null. Since it's a protected property I think it's reasonably safe to assume that a stray string isn't going to be added to the array somewhere (and typing the property natively wouldn't guarantee that either), so I agree with phpstan that checking that it's set is more correct than checking that it's an object. Also, isset() is a language construct while is_object is a function (I think?), so there's a very very very slight performance improvement. Nothing you'd be able to measure, though. All that said, I don't think reclassifying this as a Task would be wrong, if you prefer that. -
Benni Mack voted on patch set 1 V +1 CR +1 06/08/22, 19:50
-
crell uploaded patch set 2 06/09/22, 15:26
-
Oliver Klee voted on patch set 2 CR +1 06/09/22, 15:27
-
core-ci voted on patch set 2 V +1 06/09/22, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27895
-
Benni Mack voted on patch set 2 V +1 CR +1 06/09/22, 15:44
-
Andreas Kienast voted on patch set 2 V +2 CR +2 06/10/22, 08:48
-
Andreas Kienast merged patch set 3 06/10/22, 08:48