View Issue Details

IDProjectCategoryView StatusLast Update
0035284mantisbtapi restpublic2026-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 closeddregad 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 resolveddregad Upgrade Slim Framework to 3.13.0 
child of 0035216 closeddregad PHP 8.4 compatibility 

Activities

dregad

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.

dregad

dregad

2025-01-31 20:56

developer   ~0069804

PR https://github.com/mantisbt/mantisbt/pull/2087

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