Fix bug in style changes for the Use cases on the live site.
[yaffs-website] / vendor / symfony / validator / MetadataInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator;
13
14 /**
15  * A container for validation metadata.
16  *
17  * The container contains constraints that may belong to different validation
18  * groups. Constraints for a specific group can be fetched by calling
19  * {@link findConstraints}.
20  *
21  * Implement this interface to add validation metadata to your own metadata
22  * layer. Each metadata may have named properties. Each property can be
23  * represented by one or more {@link PropertyMetadataInterface} instances that
24  * are returned by {@link getPropertyMetadata}. Since
25  * <tt>PropertyMetadataInterface</tt> inherits from <tt>MetadataInterface</tt>,
26  * each property may be divided into further properties.
27  *
28  * The {@link accept} method of each metadata implements the Visitor pattern.
29  * The method should forward the call to the visitor's
30  * {@link ValidationVisitorInterface::visit} method and additionally call
31  * <tt>accept()</tt> on all structurally related metadata instances.
32  *
33  * For example, to store constraints for PHP classes and their properties,
34  * create a class <tt>ClassMetadata</tt> (implementing <tt>MetadataInterface</tt>)
35  * and a class <tt>PropertyMetadata</tt> (implementing <tt>PropertyMetadataInterface</tt>).
36  * <tt>ClassMetadata::getPropertyMetadata($property)</tt> returns all
37  * <tt>PropertyMetadata</tt> instances for a property of that class. Its
38  * <tt>accept()</tt>-method simply forwards to <tt>ValidationVisitorInterface::visit()</tt>
39  * and calls <tt>accept()</tt> on all contained <tt>PropertyMetadata</tt>
40  * instances, which themselves call <tt>ValidationVisitorInterface::visit()</tt>
41  * again.
42  *
43  * @author Bernhard Schussek <bschussek@gmail.com>
44  *
45  * @deprecated since version 2.5, to be removed in 3.0.
46  *             Use {@link Mapping\MetadataInterface} instead.
47  */
48 interface MetadataInterface
49 {
50     /**
51      * Implementation of the Visitor design pattern.
52      *
53      * Calls {@link ValidationVisitorInterface::visit} and then forwards the
54      * <tt>accept()</tt>-call to all property metadata instances.
55      *
56      * @param ValidationVisitorInterface $visitor      The visitor implementing the validation logic
57      * @param mixed                      $value        The value to validate
58      * @param string|string[]            $group        The validation group to validate in
59      * @param string                     $propertyPath The current property path in the validation graph
60      *
61      * @deprecated since version 2.5, to be removed in 3.0.
62      */
63     public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath);
64
65     /**
66      * Returns all constraints for a given validation group.
67      *
68      * @param string $group The validation group
69      *
70      * @return Constraint[] A list of constraint instances
71      */
72     public function findConstraints($group);
73 }