74388[BUGFIX] Fix undefined array key warning in TcaInline
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Oliver Klee +1
- Stefan Bürk +1
- Nikita Hovratov +1
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Nikita Hovratov +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1820
-
Oli Bartsch uploaded patch set 1 04/25/22, 12:13
-
core-ci voted on patch set 1 V +1 04/25/22, 12:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26399
-
Stefan Bürk voted on patch set 1 CR +1 04/25/22, 12:35
-
Oliver Klee commented on patch set 1 04/25/22, 12:38
-
Stefan Bürk commented on patch set 1 04/25/22, 12:40
TcaInline.php:164Reply -
Stefan Bürk commented on patch set 1 04/25/22, 12:41
TcaInline.php:164Replynull is pretty fine here. no issue. -
Stefan Bürk voted on patch set 1 V +1 04/25/22, 12:42
-
Oliver Klee commented on patch set 1 04/25/22, 12:44
TcaInline.php:164ReplyAccording to https://www.php.net/manual/en/language.types.array.php, only strings and ints are allowed. Indeed, null seems to work. However, I'd prefer our code to stick to the specs instead of relying on undocumented behavior (which might break in newer PHP versions without deprecation). -
Oliver Klee commented on patch set 1 04/25/22, 12:46
TcaInline.php:164ReplyAh: > Additionally the following key casts will occur: > […] > Null will be cast to the empty string, i.e. the key null will actually be stored under "". I'd prefer our code to be explicit, i.e., to use "" directly. Then the reader does not need to know of this casting mechanism, and they then won't need to ask themselves why our code relied on the cast instead of using "" directly. -
Oliver Klee voted on patch set 1 CR -1 04/25/22, 12:47
-
Stefan Bürk commented on patch set 1 04/25/22, 12:47
TcaInline.php:164Replyin a isset() it is pretty fine, as it checks for "not set". so it makes it obius that it should not be there. In the end, you may have places with a variable and checking with isset() or ?? if it is defined. you do not make a "type" caset or a type check before .. so using here null as default is fine (and expressive). -
Oliver Klee commented on patch set 2 04/25/22, 12:49
Published edit on patch set 1. -
Oliver Klee commented on patch set 2 04/25/22, 12:51
TcaInline.php:164ReplyI think we're mixing up two different things here (where $foo might be null): a) isset($foo) or $foo ?? … -> I'm perfectly fine with that b) isset($someArray($foo)) or $someArray($foo) ?? … -> I'm not so fine with that -
Oliver Klee voted on patch set 2 CR +1 04/25/22, 12:52
-
core-ci voted on patch set 2 V +1 04/25/22, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26400
-
Stefan Bürk commented on patch set 2 V +1 CR +1 04/25/22, 13:01
TcaInline.php:164ReplyDone -
Benni Mack voted on patch set 2 V +1 CR +1 04/25/22, 16:41
-
Nikita Hovratov voted on patch set 2 V +1 CR +1 04/25/22, 17:11
-
Oli Bartsch voted on patch set 2 V +2 CR +2 04/25/22, 19:40
-
Oli Bartsch merged patch set 3 04/25/22, 19:40
TcaInline.php:164