Review main Merged

86371[TASK] Mitigate `PHP 8.4.0-RC1` breaking changes

Stefan Bürk CR +2 V +2 Normal +58 −22 updated 10/03/24, 16:54

Commit message

Note that this change addresses three different issues, which
need to be done in one step, otherwise none of isolated patches
would get a +1 CI verification:

* Alignment for changed `$escape` parameter handling of CSV
  related methods, which must be avoided with PHP versions below
  8.4.0-beta5, but is required as of PHP 8.4.0-RC1.
* This `$escape` issue needs to be addressed directly in
  the `typo3/testing-framework` and thus needs a raised
  dependency directly.
* PHP 8.4.0.0-RC1 also deprecated the `E_STRICT` constant,
  which needs to be addressed directly.

With [1] the `$escape` parameter for the following method calls

* `str_getcsv()`
* `fputcsv()`
* `fgetcsv()`

must be provided as a 1 character long value. Omitting and
using the default value will emit a PHP deprecation [2] warning
as of PHP 8.4.0-RC1, for example:

  str_getcsv(): the $escape parameter must be provided
  as its default value will change

To mitigate this, PHP recommends following:

  It must be passed explicitly either positionally or
  via named arguments.

This change adjusts all occurences (function calls) and ensures
that the `$escape` parameter is explicitly provided via
specifying all parameters up to that position and not
using a `named arguments` approach for easier backporting.

The TYPO3 testing framework also needs to be aligned to
mitigate `fgetcsv()` issues, and is raised in the same
step - otherwise none of these changes would get a green
CI pipeline run.

The following testing-framework updates are adjusted:

* main: simple update `main` pointer
* 12.4: Raise to tag `8.2.2`
* 11.5: Raise to tag `6.16.10`

Used command(s):

> composer update "typo3/testing-framework"

Additionally, PHP 8.4.0-RC1 deprecated the `E_STRICT`
constant, which now emits a E_DEPRECATED which leads to
failed CI tests. This change introduces a core internal
constant with the same integer value, and replaces usages
with this constant to mitigate the E_DEPRECATION. This constant
can then be dropped with TYPO3 v14, preventing a breaking change
at this time. [3][4]

[1] https://github.com/php/php-src/pull/15569
[2] https://github.com/php/php-src/blob/ebee8df27ed/UPGRADING#L617-L622
[3] https://github.com/php/php-src/blob/ebee8df27edf7/UPGRADING#L47-L49
[4] https://github.com/php/php-src/pull/13053

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 15

Review log 1725

  1. Stefan Bürk uploaded patch set 1 09/29/24, 14:31

  2. core-ci voted on patch set 1 V -1 09/29/24, 14:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66795

  3. Stefan Bürk uploaded patch set 2 V -1 09/29/24, 15:11

  4. core-ci voted on patch set 2 V -1 09/29/24, 15:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66800

  5. Stefan Bürk uploaded patch set 3 V -1 09/29/24, 15:28

  6. core-ci voted on patch set 3 V -1 09/29/24, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66803

  7. core-ci commented on patch set 3 09/29/24, 15:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66803

  8. Stefan Bürk uploaded patch set 4 V -1 09/29/24, 16:18

  9. Stefan Bürk updated the commit message in patch set 5 09/29/24, 16:20

  10. core-ci voted on patch set 4 V -1 09/29/24, 16:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66805

  11. core-ci voted on patch set 5 V -1 09/29/24, 16:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66806

  12. Stefan Bürk uploaded patch set 6 V -1 09/29/24, 16:32

  13. Garvin Hicking updated the commit message in patch set 7 09/29/24, 16:33

  14. Garvin Hicking commented on patch set 7 09/29/24, 16:37

    DeprecatedConstants.php:20

    s/messaged/messages/
  15. core-ci voted on patch set 7 V +1 09/29/24, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66808

  16. Stefan Bürk uploaded patch set 8 V +1 09/29/24, 16:43

  17. Stefan Bürk commented on patch set 8 09/29/24, 16:43

    DeprecatedConstants.php:20 Reply

    Done
  18. core-ci voted on patch set 8 V +1 09/29/24, 16:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66809

  19. Garvin Hicking voted on patch set 8 CR +1 V +1 09/29/24, 17:22

  20. Anja Leichsenring voted on patch set 8 CR +1 V +1 09/29/24, 17:27

  21. Stefan Bürk voted on patch set 8 CR +2 V +2 09/29/24, 17:49

  22. Stefan Bürk merged patch set 9 09/29/24, 17:49

  23. Andreas Kienast commented on patch set 9 09/30/24, 08:25

    DeprecatedConstants.php:19

    So we're trading a deprecated constant with a deprecated constant?
  24. Benjamin Franzke commented on patch set 9 09/30/24, 08:41

    DeprecatedConstants.php:19 Reply

    I'd suggest to just use `2048` in code with a clear explanation why we do that, like: ``` @todo: remove 2048 (deprecated E_STRICT) in v14, as this value is no longer used by PHP and only here for possible custom PHP extensions that sill use it. See https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant ```
  25. Benjamin Franzke commented on patch set 9 10/03/24, 16:54

    DeprecatedConstants.php:19 Reply