From 3a50b51148f74069883bba946a0b5e3a66d11f2a Mon Sep 17 00:00:00 2001 From: rgrassian Date: Wed, 2 Mar 2022 14:15:16 +0100 Subject: [PATCH] create FormErrorIterator stub --- extension.neon | 2 ++ stubs/Symfony/Component/Form/FormError.stub | 7 +++++ .../Component/Form/FormErrorIterator.stub | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 stubs/Symfony/Component/Form/FormError.stub create mode 100644 stubs/Symfony/Component/Form/FormErrorIterator.stub diff --git a/extension.neon b/extension.neon index 1aba591e..eea601f6 100644 --- a/extension.neon +++ b/extension.neon @@ -26,6 +26,8 @@ parameters: - stubs/Symfony/Component/EventDispatcher/GenericEvent.stub - stubs/Symfony/Component/Form/DataTransformerInterface.stub - stubs/Symfony/Component/Form/FormBuilderInterface.stub + - stubs/Symfony/Component/Form/FormError.stub + - stubs/Symfony/Component/Form/FormErrorIterator.stub - stubs/Symfony/Component/Form/FormInterface.stub - stubs/Symfony/Component/Form/FormTypeExtensionInterface.stub - stubs/Symfony/Component/Form/FormTypeInterface.stub diff --git a/stubs/Symfony/Component/Form/FormError.stub b/stubs/Symfony/Component/Form/FormError.stub new file mode 100644 index 00000000..cfd9e682 --- /dev/null +++ b/stubs/Symfony/Component/Form/FormError.stub @@ -0,0 +1,7 @@ + + * @phpstan-implements \RecursiveIterator + * @phpstan-implements \SeekableIterator + */ +class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \ArrayAccess, \Countable +{ + /** + * @param array $errors + */ + public function __construct(FormInterface $form, array $errors); + + /** @return T */ + public function current(); + + /** + * @param mixed $position + * + * @return T + */ + public function offsetGet($position); +}