Skip to content

FormInterface::getErrors could have a dynamic return extension #166

Closed
@VincentLanglet

Description

@VincentLanglet

Currently, its return type is a FormErrorIterator with inside
Symfony\Component\Form\FormError|Symfony\Component\Form\FormErrorIterator

The phpdoc is

/**
     * Returns the errors of this form.
     *
     * @param bool $deep    Whether to include errors of child forms as well
     * @param bool $flatten Whether to flatten the list of errors in case
     *                      $deep is set to true
     *
     * @return FormErrorIterator An iterator over the {@link FormError}
     *                           instances that where added to this form
     */
    public function getErrors(bool $deep = false, bool $flatten = true);

So I would say it's always an iterator on Symfony\Component\Form\FormError, except if the parameter true, false are provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions