1 | <?php namespace FreedomCore\TrinityCore\Console\Abstracts; |
||
7 | abstract class BaseCommand |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Client Instance Object |
||
12 | * @var null|\SoapClient |
||
13 | */ |
||
14 | protected $clientInstance = null; |
||
15 | |||
16 | /** |
||
17 | * Name of the command |
||
18 | * @var null|string |
||
19 | */ |
||
20 | protected $command = null; |
||
21 | |||
22 | /** |
||
23 | * Available methods |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $methods = []; |
||
27 | |||
28 | /** |
||
29 | * Commands which do not need to be prefixed with BASE command |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $doNotPrefix = []; |
||
33 | |||
34 | /** |
||
35 | * Commands which methods should be concatenated |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $concatenate = []; |
||
39 | |||
40 | /** |
||
41 | * BaseCommand constructor. |
||
42 | * @param \SoapClient $client |
||
43 | */ |
||
44 | public function __construct(\SoapClient $client) |
||
50 | |||
51 | /** |
||
52 | * Get Command Name |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getCommandName() : string |
||
59 | |||
60 | /** |
||
61 | * Get Command Methods |
||
62 | * @return array |
||
63 | */ |
||
64 | public function getCommandMethods() : array |
||
68 | |||
69 | /** |
||
70 | * Execute Help Command |
||
71 | * @param string $methodName |
||
72 | * @return array |
||
73 | * @codeCoverageIgnore |
||
74 | */ |
||
75 | public function help(string $methodName = '') |
||
79 | |||
80 | /** |
||
81 | * Add quotes to string |
||
82 | * @param string $string |
||
83 | * @return string |
||
84 | */ |
||
85 | public function inQuotes(string $string) : string |
||
89 | |||
90 | /** |
||
91 | * Prepare Command Name Variable |
||
92 | */ |
||
93 | protected function prepareCommand() |
||
97 | |||
98 | /** |
||
99 | * Prepare Available Methods For Specified Command |
||
100 | */ |
||
101 | protected function prepareMethods() |
||
126 | |||
127 | /** |
||
128 | * Generate Command String |
||
129 | * @param string $method |
||
130 | * @return string |
||
131 | */ |
||
132 | protected function generateCommand(string $method) : string |
||
142 | |||
143 | /** |
||
144 | * Generate Command Query String |
||
145 | * @param string $class |
||
146 | * @param string $method |
||
147 | * @return string |
||
148 | */ |
||
149 | protected function generateQueryString(string $class, string $method) : string |
||
156 | |||
157 | /** |
||
158 | * Execute Command |
||
159 | * @param string $methodName |
||
160 | * @param array $parameters |
||
161 | * @return array|string |
||
162 | * @codeCoverageIgnore |
||
163 | */ |
||
164 | protected function executeCommand(string $methodName, array $parameters) |
||
189 | |||
190 | /** |
||
191 | * Process Response |
||
192 | * @param string $commandOutput |
||
193 | * @param bool $helpFunction |
||
194 | * @return array |
||
195 | * @codeCoverageIgnore |
||
196 | */ |
||
197 | protected function processOutput(string $commandOutput, bool $helpFunction = false) |
||
201 | |||
202 | /** |
||
203 | * Parse and Process Command |
||
204 | * @param string $command |
||
205 | * @return string |
||
206 | */ |
||
207 | protected function parseCommand(string $command) : string |
||
228 | } |
||
229 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.