Fix bug in style changes for the Use cases on the live site.
[yaffs-website] / vendor / consolidation / annotated-command / tests / src / ExampleHookAllCommandFile.php
1 <?php
2 namespace Consolidation\TestUtils;
3
4 use Symfony\Component\Console\Command\Command;
5 use Symfony\Component\Console\Input\InputInterface;
6 use Symfony\Component\Console\Output\OutputInterface;
7 use Consolidation\AnnotatedCommand\CommandError;
8 use Consolidation\AnnotatedCommand\AnnotationData;
9
10 /**
11  *
12  */
13 class ExampleHookAllCommandFile
14 {
15     public function doCat($one, $two = '', $options = ['flip' => false])
16     {
17         if ($options['flip']) {
18             return "{$two}{$one}";
19         }
20         return "{$one}{$two}";
21     }
22
23     public function doRepeat($one, $two = '', $options = ['repeat' => 1])
24     {
25         return str_repeat("{$one}{$two}", $options['repeat']);
26     }
27
28     /**
29      * This hook function does not specify which command or annotation
30      * it is hooking; that makes it apply to every command in the same class.
31      *
32      * @hook alter
33      */
34     public function alterAllCommands($result)
35     {
36         if (is_string($result)) {
37             $result = "*** $result ***";
38         }
39         return $result;
40     }
41 }