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')

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fago created an issue. See original summary.

fago’s picture

Status: Active » Needs review

added a quick MR to address the phpstan issues. Note: I created this with the help of AI.

ciprian.stavovei’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, build is green!

batigolix made their first commit to this issue’s fork.

batigolix’s picture

Status: Reviewed & tested by the community » Fixed

I locally tested this and it works well. I will close this. Many thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • batigolix committed 659a6e18 on 3.0.x authored by fago
    feat: #3566606 Deprecations cause phpstan errors
    
    By: fago
    By: ciprian....

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.