Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / output-formatters / src / Formatters / NoOutputFormatter.php
1 <?php
2 namespace Consolidation\OutputFormatters\Formatters;
3
4 use Consolidation\OutputFormatters\Validate\ValidationInterface;
5 use Consolidation\OutputFormatters\Options\FormatterOptions;
6 use Consolidation\OutputFormatters\Validate\ValidDataTypesTrait;
7 use Symfony\Component\Console\Output\OutputInterface;
8
9 /**
10  * No output formatter
11  *
12  * This formatter never produces any output. It is useful in cases where
13  * a command should not produce any output by default, but may do so if
14  * the user explicitly includes a --format option.
15  */
16 class NoOutputFormatter implements FormatterInterface, ValidationInterface
17 {
18     /**
19      * All data types are acceptable.
20      */
21     public function isValidDataType(\ReflectionClass $dataType)
22     {
23         return true;
24     }
25
26     /**
27      * @inheritdoc
28      */
29     public function validate($structuredData)
30     {
31         return $structuredData;
32     }
33
34     /**
35      * @inheritdoc
36      */
37     public function write(OutputInterface $output, $data, FormatterOptions $options)
38     {
39     }
40 }