Deprecations cause phpstan errors

Created on 9 January 2026, 7 days ago

Problem

Gitlab CI fails with php stan errors.

Proposed resolution

AI generated solution:

PHPStan Errors (2 errors)

Lines 293 & 299 in RestMenuItemsResource.php:
Call to deprecated method get() of class Symfony\Component\HttpFoundation\Request:
since Symfony 7.4, use properties `->attributes`, `query` or `request` directly instead

This is in the setup() method:
$request = \Drupal::request();
$max = $request->get('max_depth'); // Line 293 - deprecated
$min = $request->get('min_depth'); // Line 299 - deprecated

Fix Required

Change from:
$request->get('max_depth')
$request->get('min_depth')

To:
$request->query->get('max_depth')
$request->query->get('min_depth')

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇦🇹Austria fago Vienna

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024