mvlabs / ze-content-validation

Middleware for automating validation of incoming input.
http://www.mvlabs.it
8 stars 7 forks source link

[fix-validation-result] Fix validation result if nested input filters… #17

Open KhadaRoss opened 3 years ago

KhadaRoss commented 3 years ago

… get provided

When i was using an InputFilter with a nested CollectionInputFilter i saw that this ValidationResult tries to use CollectionFilter::getName, which causes an error because the property $invalidInputs of the CollectionInputFilter can also return InputFilterInterface[]

/**
 * @var InputInterface[]|InputFilterInterface[]
 */
protected $invalidInputs;

however this ValidationResult only works if you get InputInterface[]. fortunately the index variable of this foreach always contains the name that is needed for this ValidationResult.

the interfaces dont seem to fit together perfectly, see https://github.com/laminas/laminas-inputfilter/issues/22 by func0der