Fix deprecated assert_options() function usage for PHP 8.3

Created on 19 July 2023, 11 months ago
Updated 16 March 2024, 3 months ago

Problem/Motivation

The assert_options() is deprecated in upcoming PHP 8.3 so linter can't pass https://www.drupal.org/pift-ci-job/2719854

- https://wiki.php.net/rfc/assert-string-eval-cleanup and https://www.php.net/manual/en/function.assert-options

Steps to reproduce

/var/www/html/web $ php -r 'assert_options(1);'
PHP Deprecated:  Function assert_options() is deprecated in Command line code on line 1

Deprecated: Function assert_options() is deprecated in Command line code on line 1

Proposed resolution

- provide replacement depending on PHP version
- update documentation https://www.drupal.org/node/2492225
- update CR https://www.drupal.org/node/3105918 as assertions no longer a runtime setting
- add change record

Remaining tasks

- agree
- patch/review
- commit

User interface changes

no

API changes

- Assertions are no longer configurable via settings.php
- content entity preSave() now throw LogicException if no validation executed before saving entity
- \Drupal\jsonapi\EventSubscriber\ResourceResponseValidator::doValidateResponse() removed as it exists only to simplify testing

Data model changes

no

Release notes snippet

no

📌 Task
Status

Fixed

Version

10.2

Component
Base 

Last updated 40 minutes ago

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024