Version 1
[yaffs-website] / vendor / consolidation / output-formatters / src / Validate / ValidDataTypesInterface.php
1 <?php
2 namespace Consolidation\OutputFormatters\Validate;
3
4 /**
5  * Formatters may implement ValidDataTypesInterface in order to indicate
6  * exactly which formats they support.  The validDataTypes method can be
7  * called to retrieve a list of data types useful in providing hints in
8  * exception messages about which data types can be used with the formatter.
9  *
10  * Note that it is OPTIONAL for formatters to implement this interface.
11  * If a formatter implements only ValidationInterface, then clients that
12  * request the formatter via FormatterManager::write() will still get a list
13  * (via an InvalidFormatException) of all of the formats that are usable
14  * with the provided data type.  Implementing ValidDataTypesInterface is
15  * benefitial to clients who instantiate a formatter directly (via `new`).
16  *
17  * Formatters that implement ValidDataTypesInterface may wish to use
18  * ValidDataTypesTrait.
19  */
20 interface ValidDataTypesInterface extends ValidationInterface
21 {
22     /**
23      * Return the list of data types acceptable to this formatter
24      *
25      * @return \ReflectionClass[]
26      */
27     public function validDataTypes();
28 }