2 namespace Consolidation\TestUtils\beta;
4 use Consolidation\AnnotatedCommand\AnnotationData;
5 use Consolidation\AnnotatedCommand\CommandData;
8 * Test file used in the testCommandDiscovery() test.
10 * This commandfile is not found by the test. The test search base is the
11 * 'src' directory, but 'beta' is NOT one of the search directories available
12 * for searching, so nothing in this folder will be examined.
16 public function unavailableCommand()
18 return 'This command is not available, because this commandfile is not in a location that is searched by the tests.';
22 * Demonstrate an alter hook with an option
24 * @hook alter example:table
25 * @option chinese Add a row with Chinese numbers.
26 * @usage example:table --chinese
28 public function alterFormattersChinese($result, CommandData $commandData)
30 if ($commandData->input()->getOption('chinese')) {
31 $result[] = [ 'first' => '壹', 'second' => '貳', 'third' => '叁' ];
38 * Demonstrate an alter hook with an option
41 * @option kanji Add a row with Kanji numbers.
42 * @usage example:table --kanji
44 public function alterFormattersKanji($result, CommandData $commandData)
46 if ($commandData->input()->getOption('kanji')) {
47 $result[] = [ 'first' => '一', 'second' => '二', 'third' => '三' ];