2 namespace Consolidation\TestUtils;
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;
13 class ExampleHookAllCommandFile
15 public function doCat($one, $two = '', $options = ['flip' => false])
17 if ($options['flip']) {
18 return "{$two}{$one}";
20 return "{$one}{$two}";
23 public function doRepeat($one, $two = '', $options = ['repeat' => 1])
25 return str_repeat("{$one}{$two}", $options['repeat']);
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.
34 public function alterAllCommands($result)
36 if (is_string($result)) {
37 $result = "*** $result ***";