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')
Issue fork rest_menu_items-3566606
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
Comment #3
fagoadded a quick MR to address the phpstan issues. Note: I created this with the help of AI.
Comment #4
ciprian.stavovei commentedLooks good, build is green!
Comment #6
batigolixI locally tested this and it works well. I will close this. Many thanks!