8000 [Form] Introduced proxy methods to allow easier handling of form errors by zebba · Pull Request #29521 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Introduced proxy methods to allow easier handling of form errors #29521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed codestyle
  • Loading branch information
zebba committed Dec 8, 2018
commit 60df1f3e2598715b525e062b3c2c008f3d2304ca
6 changes: 4 additions & 2 deletions src/Symfony/Component/Form/FormInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ public function getErrors($deep = false, $flatten = true);
* Returns the list of the current form and all child forms.
*
* @return FormErrorIterator An iterator over the {@link FormError}
* instances that where added to the form and the child forms.
* instances that where added to the form
* and the child forms.
*/
public function getAllErrors();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot change the interface until Symfony 5.0 for BC.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually totally forgot about that part and agree. I've changed the description.


/**
* Returns the list of this form only - without child errors.
*
* @return FormErrorIterator an iterator over the {@link FormError}
* instances that where added to the top level of this form.
* instances that where added to the top
* level of this form.
*/
public function getOnlyGlobalErrors();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name sounds confusing for a form which is not the root.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to stick with the naming in the current documentation:

// a FormErrorIterator instance, but only errors attached to this
// form level (e.g. global errors)

But getRootErrors() works for me too if this is a naming we can agree on? The suggested getOwnErrors() didn't appeal to me.

40C6
Expand Down
0