Issue Task Closed

#103927Avoid implicitly nullable class method parameter

Stefan Bürk 05/26/24, 20:42 updated 07/09/24, 15:35

Description

With PHP 8.4 marking method parameter implicitly nullable
is depreacted and will emit a `E_DEPRECATED` warning. One
recommended way to resolve this, is making it explicitly
nullable using the `?` nullable operator. [1]

In cases, where are implicitly nullable parameter exists
before not-nullable parameters in a method or constructor,
making it explicitly nullable will emit a

Optional parameter <paramname> declared before required
parameter <paramname> is implicitly treated as a required
parameter

since PHP 8.0 [2].

[1] https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated
2 https://php.watch/versions/8.0/deprecate-required-param-after-optional

Reviews 3

History 28

  1. Gerrit Code Review pushed patch set 1 for main to change 84416 status New Under Review 05/26/24, 20:58

  2. Gerrit Code Review pushed patch set 2 for main to change 84416 05/26/24, 21:22

  3. Gerrit Code Review pushed patch set 3 for main to change 84416 05/27/24, 10:23

  4. Gerrit Code Review pushed patch set 1 for 12.4 to change 84362 05/27/24, 12:24

  5. Gerrit Code Review pushed patch set 1 for 11.5 to change 84363 05/27/24, 12:24

  6. Gerrit Code Review pushed patch set 2 for 11.5 to change 84363 05/27/24, 12:38

  7. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % 05/27/24, 12:55

    Applied in changeset commit:c150d062731598c2c2bad147e13b851df909b9c4.

  8. Benni Mack changed status Resolved Closed 07/09/24, 15:35