1 | <?php namespace FreedomCore\TrinityCore\Console\Abstracts; |
||
7 | abstract class BaseCommand { |
||
8 | |||
9 | /** |
||
10 | * Client Instance Object |
||
11 | * @var null|\SoapClient |
||
12 | */ |
||
13 | protected $clientInstance = null; |
||
14 | |||
15 | /** |
||
16 | * Name of the command |
||
17 | * @var null|string |
||
18 | */ |
||
19 | protected $command = null; |
||
20 | |||
21 | /** |
||
22 | * Available methods |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $methods = []; |
||
26 | |||
27 | /** |
||
28 | * Commands which do not need to be prefixed with BASE command |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $doNotPrefix = []; |
||
32 | |||
33 | /** |
||
34 | * Commands which methods should be concatenated |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $concatenate = []; |
||
38 | |||
39 | /** |
||
40 | * BaseCommand constructor. |
||
41 | * @param \SoapClient $client |
||
42 | */ |
||
43 | public function __construct(\SoapClient $client) { |
||
48 | |||
49 | /** |
||
50 | * Execute Help Command |
||
51 | * @param string $methodName |
||
52 | * @return string |
||
53 | */ |
||
54 | public function help(string $methodName = '') { |
||
57 | |||
58 | /** |
||
59 | * Prepare Command Name Variable |
||
60 | */ |
||
61 | protected function prepareCommand() { |
||
64 | |||
65 | /** |
||
66 | * Prepare Available Methods For Specified Command |
||
67 | */ |
||
68 | protected function prepareMethods() { |
||
79 | |||
80 | /** |
||
81 | * Generate Command String |
||
82 | * @param string $method |
||
83 | * @return string |
||
84 | */ |
||
85 | protected function generateCommand(string $method) : string { |
||
93 | |||
94 | /** |
||
95 | * Generate Command Query String |
||
96 | * @param string $class |
||
97 | * @param string $method |
||
98 | * @return string |
||
99 | */ |
||
100 | protected function generateQueryString(string $class, string $method) : string { |
||
104 | |||
105 | /** |
||
106 | * Add quotes to string |
||
107 | * @param string $string |
||
108 | * @return string |
||
109 | */ |
||
110 | protected function inQuotes(string $string) : string { |
||
113 | |||
114 | /** |
||
115 | * Execute Command |
||
116 | * @param string $methodName |
||
117 | * @param array $parameters |
||
118 | * @return array|string |
||
119 | */ |
||
120 | protected function executeCommand(string $methodName, array $parameters) { |
||
144 | |||
145 | /** |
||
146 | * Process Response |
||
147 | * @param string $commandOutput |
||
148 | * @param bool $helpFunction |
||
149 | * @return array |
||
150 | */ |
||
151 | protected function processOutput(string $commandOutput, bool $helpFunction = false) { |
||
154 | |||
155 | /** |
||
156 | * Parse and Process Command |
||
157 | * @param string $command |
||
158 | * @return string |
||
159 | */ |
||
160 | protected function parseCommand(string $command) : string { |
||
180 | |||
181 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.