Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Control traversal on class level #8617

Closed
@webmozart

Description

@webmozart

Currently, the validator will traverse objects that implement\Traversable if

  • the object was reached via aValid constraint withtraverse set totrue
  • the parameter$traverse was set totrue when callingValidator::validate()

This has two negative consequences:

  • it's impossible to specify only once that a specific class should never/always be traversed
  • it's impossible to specify whether an object should be traversed whenValidator::validate() is not called manually, but through another system (e.g. the Form component - see[Form][Bug] Embedded form validation bubbling #8557)

A solution would be to add configuration parameters for specifying the traversal policy on a class level, for example:

// not traversed by defaultclass Fooimplements \IteratorAggregate{// ...}// traversed/** @Assert\Traverse */class Barimplements \IteratorAggregate{}// traversed recursively/** @Assert\Traverse(deep=true) */class Bazimplements \IteratorAggregate{}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp