Closed (fixed)
Project:
GraphQL
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2026 at 11:05 UTC
Updated:
30 Mar 2026 at 13:05 UTC
Jump to comment: Most recent
PHPStan provides the following errors on 8.x-4.x which are likely because of automated version upgrades since our last commit on that branch.
------ ----------------------------------------------------------------------
Line src/Annotation/DataProducer.php
------ ----------------------------------------------------------------------
46 PHPDoc tag @throws with type
Doctrine\Common\Annotations\AnnotationException is not subtype of
Throwable
🪪 throws.notThrowable
48 Instantiated class Doctrine\Common\Annotations\AnnotationException
not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
48 Throwing object of an unknown class
Doctrine\Common\Annotations\AnnotationException.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Annotation/PersistedQuery.php
------ ----------------------------------------------------------------------
46 PHPDoc tag @throws with type
Doctrine\Common\Annotations\AnnotationException is not subtype of
Throwable
🪪 throws.notThrowable
48 Instantiated class Doctrine\Common\Annotations\AnnotationException
not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
48 Throwing object of an unknown class
Doctrine\Common\Annotations\AnnotationException.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Annotation/Schema.php
------ ----------------------------------------------------------------------
46 PHPDoc tag @throws with type
Doctrine\Common\Annotations\AnnotationException is not subtype of
Throwable
🪪 throws.notThrowable
48 Instantiated class Doctrine\Common\Annotations\AnnotationException
not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
48 Throwing object of an unknown class
Doctrine\Common\Annotations\AnnotationException.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Annotation/SchemaExtension.php
------ ----------------------------------------------------------------------
62 PHPDoc tag @throws with type
Doctrine\Common\Annotations\AnnotationException is not subtype of
Throwable
🪪 throws.notThrowable
64 Instantiated class Doctrine\Common\Annotations\AnnotationException
not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
64 Throwing object of an unknown class
Doctrine\Common\Annotations\AnnotationException.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------
------ --------------------------------------------------------------
Line src/Controller/ExplorerController.php
------ --------------------------------------------------------------
104 Call to deprecated method get() of class
Symfony\Component\HttpFoundation\Request:
since Symfony 7.4, use properties `->attributes`, `query` or
`request` directly instead
🪪 method.deprecated
105 Call to deprecated method get() of class
Symfony\Component\HttpFoundation\Request:
since Symfony 7.4, use properties `->attributes`, `query` or
`request` directly instead
🪪 method.deprecated
------ --------------------------------------------------------------
[ERROR] Found 14 errors
Address the deprecations; or ignore them and flag future incompatibility if we can only fix this on 5.x
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 #4
nickolajReplaced `Doctrine\Common\Annotations\AnnotationException` with `\InvalidArgumentException` in all 4 annotation classes (no longer available as a dependency), and replaced deprecated `$request->get()` calls with `$request->query->get()` in `ExplorerController.php`.
Comment #5
kingdutchThanks for your contribution nickolaj. To make sure we don't accidentally break 4.x the proposed changes need some work.
Depending on how we see the BC layer of this, changing out the exception to one that does not subclass the original can cause downstream code to fail in its error handling. Additionally https://www.drupal.org/node/3551049 leaves a more appropriate class in place than "InvalidArgumentException".
For the explorer we'll need to be sure that the explorer provides the query and variables as `$_GET` parameters (`query`) rather than `$_POST` parameters (`request`) and does not change the two depending on something. For example GraphQL requests outside of the explorer can be done using both GET and POST; so using only one parameter bag would not work.
Comment #6
nickolaj1. Replaced InvalidArgumentException with Drupal\Component\Annotation\Doctrine\AnnotationException as suggested — good point about preserving BC for downstream exception handling. Referenced #3551049 for the
appropriate Drupal core replacement.
2. Reverted ExplorerController changes entirely — you're right that $request->get() is the correct approach here since it covers both GET and POST parameter bags.
Comment #7
klausiLooks good to me, thanks!
Leaving this for @Kingdutch to double-check and commit.
Comment #9
klausiMerged, as I need this to check #3578663: SplObjectStorage::contains and ::attach are deprecated in PHP 8.5.