0035284: Allow REST API to run on PHP 8.4 ignoring E_DEPRECATED notices - MantisBT

View Issue Details

IDProjectCategoryView StatusDate SubmittedLast Update
0035284mantisbtapi restpublic2025年01月31日 19:202026年07月06日 13:08
Reporterdregad Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Target Version2.28.0Fixed in Version2.28.0 
Summary0035284: Allow REST API to run on PHP 8.4 ignoring E_DEPRECATED notices
Description

Issue 0032866 implemented a workaround to run Slim 3.x on PHP 8.1 using a custom error handler to catch deprecation warnings.

Some further adjustments are needed to ignore new warnings, some of which are triggered before the error handler is in place.

Deprecated: Implicitly marking parameter ... as nullable is deprecated, the explicit nullable type must be used instead

  • Slim\App::subRequest(): $response

  • Slim\MiddlewareAwareTrait::seedMiddlewareStack(): $kernel

  • Slim\DeferredCallable::__construct(): $container

  • Slim\Router::__construct(): $parser

  • Slim\RouteGroup::__invoke(): $app

  • Slim\Http\Response::__construct(): $headers

TagsPHP 8.1

Relationships

related to  0032866 closed dregad   Allow REST API to run on PHP 8.1 without squelching E_DEPRECATED notices 
related to  0031699 confirmed   Upgrade Slim Framework to 4.x 
related to  0037288 resolved dregad   Upgrade Slim Framework to 3.13.0 
child of  0035216 closed dregad   PHP 8.4 compatibility 

Activities

dregad

2025年01月31日 19:22

developer   ~0069799

We need to override the error_reporting() when initializing Slim framework to squelch initial deprecation warnings, and ignore a few additional classes in the custom error handler.

Related Changesets

MantisBT: master d5a30a0c

2025年01月31日 19:28

dregad


Details Diff Catch Slim 3.x deprecated warnings on PHP 8.4

Override error_reporting to ignore E_DEPRECATED when initializing Slim
framework to squelch initial deprecation warnings, ignore a few
additional classes in the custom error handler, then restore
error_reporting to its original state before executing the request.

Fixes 0035284 Affected Issues
0035284
mod - api/rest/index.php Diff File
Powered by MantisBT 2.29.0-dev-master-e4ff7ef87
Copyright © 2000 - 2026 MantisBT Team
Contact administrator for assistance
Page execution time: 0.1672 seconds    

AltStyle によって変換されたページ (->オリジナル) /