Mercurial > hg > isophonics-drupal-site
annotate vendor/symfony/validator/Mapping/TraversalStrategy.php @ 19:fa3358dc1485 tip
Add ndrum files
| author | Chris Cannam |
|---|---|
| date | Wed, 28 Aug 2019 13:14:47 +0100 |
| parents | 4c8ae668cc8c |
| children |
| rev | line source |
|---|---|
| Chris@0 | 1 <?php |
| Chris@0 | 2 |
| Chris@0 | 3 /* |
| Chris@0 | 4 * This file is part of the Symfony package. |
| Chris@0 | 5 * |
| Chris@0 | 6 * (c) Fabien Potencier <fabien@symfony.com> |
| Chris@0 | 7 * |
| Chris@0 | 8 * For the full copyright and license information, please view the LICENSE |
| Chris@0 | 9 * file that was distributed with this source code. |
| Chris@0 | 10 */ |
| Chris@0 | 11 |
| Chris@0 | 12 namespace Symfony\Component\Validator\Mapping; |
| Chris@0 | 13 |
| Chris@0 | 14 /** |
| Chris@0 | 15 * Specifies whether and how a traversable object should be traversed. |
| Chris@0 | 16 * |
| Chris@0 | 17 * If the node traverser traverses a node whose value is an instance of |
| Chris@0 | 18 * {@link \Traversable}, and if that node is either a class node or if |
| Chris@0 | 19 * cascading is enabled, then the node's traversal strategy will be checked. |
| Chris@0 | 20 * Depending on the requested traversal strategy, the node traverser will |
| Chris@0 | 21 * iterate over the object and cascade each object or collection returned by |
| Chris@0 | 22 * the iterator. |
| Chris@0 | 23 * |
| Chris@0 | 24 * The traversal strategy is ignored for arrays. Arrays are always iterated. |
| Chris@0 | 25 * |
| Chris@0 | 26 * @author Bernhard Schussek <bschussek@gmail.com> |
| Chris@0 | 27 * |
| Chris@0 | 28 * @see CascadingStrategy |
| Chris@0 | 29 */ |
| Chris@0 | 30 class TraversalStrategy |
| Chris@0 | 31 { |
| Chris@0 | 32 /** |
| Chris@0 | 33 * Specifies that a node's value should be iterated only if it is an |
| Chris@0 | 34 * instance of {@link \Traversable}. |
| Chris@0 | 35 */ |
| Chris@0 | 36 const IMPLICIT = 1; |
| Chris@0 | 37 |
| Chris@0 | 38 /** |
| Chris@0 | 39 * Specifies that a node's value should never be iterated. |
| Chris@0 | 40 */ |
| Chris@0 | 41 const NONE = 2; |
| Chris@0 | 42 |
| Chris@0 | 43 /** |
| Chris@0 | 44 * Specifies that a node's value should always be iterated. If the value is |
| Chris@0 | 45 * not an instance of {@link \Traversable}, an exception should be thrown. |
| Chris@0 | 46 */ |
| Chris@0 | 47 const TRAVERSE = 4; |
| Chris@0 | 48 |
| Chris@0 | 49 /** |
| Chris@0 | 50 * Not instantiable. |
| Chris@0 | 51 */ |
| Chris@0 | 52 private function __construct() |
| Chris@0 | 53 { |
| Chris@0 | 54 } |
| Chris@0 | 55 } |
