Minor dependency updates
[yaffs-website] / vendor / consolidation / annotated-command / tests / src / beta / BetaCommandFile.php
1 <?php
2 namespace Consolidation\TestUtils\beta;
3
4 use Consolidation\AnnotatedCommand\AnnotationData;
5 use Consolidation\AnnotatedCommand\CommandData;
6
7 /**
8  * Test file used in the testCommandDiscovery() test.
9  *
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.
13  */
14 class BetaCommandFile
15 {
16     public function unavailableCommand()
17     {
18         return 'This command is not available, because this commandfile is not in a location that is searched by the tests.';
19     }
20
21     /**
22      * Demonstrate an alter hook with an option
23      *
24      * @hook alter example:table
25      * @option chinese Add a row with Chinese numbers.
26      * @usage example:table --chinese
27      */
28     public function alterFormattersChinese($result, CommandData $commandData)
29     {
30         if ($commandData->input()->getOption('chinese')) {
31             $result[] = [ 'first' => '壹',  'second' => '貳',  'third' => '叁'  ];
32         }
33
34         return $result;
35     }
36
37     /**
38      * Demonstrate an alter hook with an option
39      *
40      * @hook alter *
41      * @option kanji Add a row with Kanji numbers.
42      * @usage example:table --kanji
43      */
44     public function alterFormattersKanji($result, CommandData $commandData)
45     {
46         if ($commandData->input()->getOption('kanji')) {
47             $result[] = [ 'first' => '一',  'second' => '二',  'third' => '三'  ];
48         }
49
50         return $result;
51     }
52 }