From 353c9b0be952d7d98a743922570436fa4953ab29 Mon Sep 17 00:00:00 2001 From: HypeMC <2445045+HypeMC@users.noreply.github.com> Date: Sat, 22 Jun 2024 10:33:24 +0200 Subject: [PATCH] Add stubs for Symfony 7 (#352) --- .../Controller/AbstractController.stubphp | 26 +++++++++++++++ .../Component/HttpFoundation/InputBag.stubphp | 32 +++++++++++++++++++ .../HttpFoundation/ParameterBag.stubphp | 30 +++++++++++++++++ .../Component/HttpFoundation/Request.stubphp | 21 ++++++++++++ .../Normalizer/DenormalizerInterface.stubphp | 15 +++++++++ 5 files changed, 124 insertions(+) create mode 100644 src/Stubs/7/Bundle/FrameworkBundle/Controller/AbstractController.stubphp create mode 100644 src/Stubs/7/Component/HttpFoundation/InputBag.stubphp create mode 100644 src/Stubs/7/Component/HttpFoundation/ParameterBag.stubphp create mode 100644 src/Stubs/7/Component/HttpFoundation/Request.stubphp create mode 100644 src/Stubs/7/Component/Serializer/Normalizer/DenormalizerInterface.stubphp diff --git a/src/Stubs/7/Bundle/FrameworkBundle/Controller/AbstractController.stubphp b/src/Stubs/7/Bundle/FrameworkBundle/Controller/AbstractController.stubphp new file mode 100644 index 0000000..e4bd43b --- /dev/null +++ b/src/Stubs/7/Bundle/FrameworkBundle/Controller/AbstractController.stubphp @@ -0,0 +1,26 @@ + + * + * @psalm-param class-string $type + * + * @psalm-return FormInterface + */ + protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface {} +} diff --git a/src/Stubs/7/Component/HttpFoundation/InputBag.stubphp b/src/Stubs/7/Component/HttpFoundation/InputBag.stubphp new file mode 100644 index 0000000..d959d5f --- /dev/null +++ b/src/Stubs/7/Component/HttpFoundation/InputBag.stubphp @@ -0,0 +1,32 @@ + + */ + public InputBag $query; + + /** + * @psalm-var InputBag + */ + public InputBag $cookies; +} diff --git a/src/Stubs/7/Component/Serializer/Normalizer/DenormalizerInterface.stubphp b/src/Stubs/7/Component/Serializer/Normalizer/DenormalizerInterface.stubphp new file mode 100644 index 0000000..86a10a5 --- /dev/null +++ b/src/Stubs/7/Component/Serializer/Normalizer/DenormalizerInterface.stubphp @@ -0,0 +1,15 @@ + + * + * @psalm-param TType $type + * @psalm-return (TType is class-string ? TObject : mixed) + */ + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed; +}