Mercurial > hg > isophonics-drupal-site
annotate vendor/consolidation/output-formatters/src/Validate/ValidationInterface.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 namespace Consolidation\OutputFormatters\Validate; |
Chris@0 | 3 |
Chris@0 | 4 /** |
Chris@0 | 5 * Formatters may implement ValidationInterface in order to indicate |
Chris@0 | 6 * whether a particular data structure is supported. Any formatter that does |
Chris@0 | 7 * not implement ValidationInterface is assumed to only operate on arrays, |
Chris@0 | 8 * or data types that implement SimplifyToArrayInterface. |
Chris@0 | 9 */ |
Chris@0 | 10 interface ValidationInterface |
Chris@0 | 11 { |
Chris@0 | 12 /** |
Chris@0 | 13 * Return true if the specified format is valid for use with |
Chris@0 | 14 * this formatter. |
Chris@0 | 15 */ |
Chris@0 | 16 public function isValidDataType(\ReflectionClass $dataType); |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Throw an IncompatibleDataException if the provided data cannot |
Chris@0 | 20 * be processed by this formatter. Return the source data if it |
Chris@0 | 21 * is valid. The data may be encapsulated or converted if necessary. |
Chris@0 | 22 * |
Chris@0 | 23 * @param mixed $structuredData Data to validate |
Chris@0 | 24 * |
Chris@0 | 25 * @return mixed |
Chris@0 | 26 */ |
Chris@0 | 27 public function validate($structuredData); |
Chris@0 | 28 } |