1 | <?php |
||
10 | class OpCommands extends \Robo\Tasks |
||
11 | { |
||
12 | /** |
||
13 | * Test the expression parser |
||
14 | * |
||
15 | * @command parse |
||
16 | * @return array |
||
17 | */ |
||
18 | public function parse($expr, $options = ['format' => 'yaml', 'dump' => false]) |
||
31 | |||
32 | /** |
||
33 | * Convert a command from one format to another, potentially with filtering. |
||
34 | * |
||
35 | * @command edit |
||
36 | * @aliases ed |
||
37 | * @filter-output |
||
38 | * @return array |
||
39 | */ |
||
40 | public function edit($data, $options = ['format' => 'yaml', 'in' => 'auto']) |
||
44 | |||
45 | /** |
||
46 | * @hook alter @filter-output |
||
47 | * @option $filter Filter output based on provided expression |
||
48 | * @default $filter '' |
||
49 | */ |
||
50 | public function filterOutput($result, CommandData $commandData) |
||
62 | |||
63 | /** |
||
64 | * Read the data provided to this command. |
||
65 | */ |
||
66 | protected function read($data, $in) |
||
80 | |||
81 | /** |
||
82 | * Convert our provided input data to a php array. |
||
83 | */ |
||
84 | protected function parseData($data, $in) |
||
97 | |||
98 | /** |
||
99 | * If the data type is 'auto', then try to infer what data type |
||
100 | * we should parse as based on the contents of the data. |
||
101 | */ |
||
102 | protected function inferInputFormat($data, $in) |
||
117 | } |
||
118 |