From 65586604237c9062c15adc92faee5f84d1698af6 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Thu, 14 Oct 2021 07:48:39 +0300 Subject: [PATCH] [validator] add ConstraintViolationListInterface.stubphp (#222) --- .../ConstraintViolationListInterface.stubphp | 10 +++++++ .../ConstraintViolationListInterface.feature | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/Stubs/common/Component/Validator/ConstraintViolationListInterface.stubphp create mode 100644 tests/acceptance/acceptance/ConstraintViolationListInterface.feature diff --git a/src/Stubs/common/Component/Validator/ConstraintViolationListInterface.stubphp b/src/Stubs/common/Component/Validator/ConstraintViolationListInterface.stubphp new file mode 100644 index 0000000..6ea2825 --- /dev/null +++ b/src/Stubs/common/Component/Validator/ConstraintViolationListInterface.stubphp @@ -0,0 +1,10 @@ + + */ +interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess +{ +} diff --git a/tests/acceptance/acceptance/ConstraintViolationListInterface.feature b/tests/acceptance/acceptance/ConstraintViolationListInterface.feature new file mode 100644 index 0000000..0e9e0c8 --- /dev/null +++ b/tests/acceptance/acceptance/ConstraintViolationListInterface.feature @@ -0,0 +1,28 @@ +@symfony-common +Feature: ConstraintViolationListInterface + + Background: + Given I have Symfony plugin enabled + + Scenario: ConstraintViolationListInterface is a Traversable with int key and ConstraintViolationInterface value + Given I have the following code + """ + $value) { + /** @psalm-trace $key */ + echo $key; + /** @psalm-trace $value */ + } + } + """ + When I run Psalm + Then I see these errors + | Type | Message | + | Trace | $key: int | + | Trace | $value: Symfony\Component\Validator\ConstraintViolationInterface | + And I see no other errors