1 | <?php |
||
15 | class Command |
||
16 | { |
||
17 | /** |
||
18 | * CLI tool. |
||
19 | * @var CLImate CLImate instance. |
||
20 | */ |
||
21 | protected $cli; |
||
22 | |||
23 | /** |
||
24 | * Analyser. |
||
25 | * @var Analyser analyser instance. |
||
26 | */ |
||
27 | protected $analyser; |
||
28 | |||
29 | /** |
||
30 | * Command line arguments. |
||
31 | * @var array list of arguments. |
||
32 | */ |
||
33 | protected $arguments; |
||
34 | |||
35 | /** |
||
36 | * Analysis targets paths. |
||
37 | * @var array list of files and directories paths. |
||
38 | */ |
||
39 | protected $analysedPaths; |
||
40 | |||
41 | /** |
||
42 | * Composer binaries directory path. |
||
43 | * @var string directory path. |
||
44 | */ |
||
45 | protected $binariesPath; |
||
46 | |||
47 | /** |
||
48 | * Set dependencies and initialize CLI. |
||
49 | * @param CLImate $climate CLImate instance. |
||
50 | * @param string $binariesPath Composer binaries path. |
||
51 | * @param array $arguments command line arguments. |
||
52 | */ |
||
53 | public function __construct(CLImate $climate, $binariesPath, array $arguments) |
||
64 | |||
65 | /** |
||
66 | * Run PHP-Hound command. |
||
67 | * @return boolean true if it didn't find code issues or ran successfully. |
||
68 | */ |
||
69 | public function run() |
||
92 | |||
93 | /** |
||
94 | * Create a DiffOutputFilter based on a git-diff param. |
||
95 | * @param string $gitDiff git diff arguments. |
||
96 | * @return DiffOutputFilter filter instance. |
||
97 | */ |
||
98 | protected function getGitDiffFilter($gitDiff) |
||
114 | |||
115 | /** |
||
116 | * Initialize output. |
||
117 | * @throws UnexpectedValueException on invalid format value. |
||
118 | * @return AbstractOutput |
||
119 | */ |
||
120 | protected function getOutput() |
||
138 | |||
139 | /** |
||
140 | * Command line arguments list for CLImate. |
||
141 | * @return array CLI list of arguments. |
||
142 | */ |
||
143 | protected function getArguments() |
||
185 | |||
186 | /** |
||
187 | * Get a list of paths to be ignored by the analysis. |
||
188 | * @return string[] a list of file and/or directory paths. |
||
189 | */ |
||
190 | public function getIgnoredPaths() |
||
196 | |||
197 | /** |
||
198 | * Parse a string of comma separated files and/or directories to be analysed. |
||
199 | * @param string $pathsString the path argument value. |
||
200 | * @return void |
||
201 | */ |
||
202 | protected function setAnalysedPathsFromString($pathsString) |
||
208 | |||
209 | /** |
||
210 | * Set target files and/or directories to be analysed. Fix relative paths. |
||
211 | * @param string[] $paths target paths. |
||
212 | * @return void |
||
213 | */ |
||
214 | protected function setAnalysedPaths(array $paths) |
||
224 | |||
225 | /** |
||
226 | * Analysis target paths. |
||
227 | * @return string[] a list of analysed paths (usually just one). |
||
228 | */ |
||
229 | public function getAnalysedPaths() |
||
233 | |||
234 | /** |
||
235 | * Running script path. |
||
236 | * @return string current script directory. |
||
237 | */ |
||
238 | public function getWorkingDirectory() |
||
242 | |||
243 | /** |
||
244 | * Output format. |
||
245 | * @return string format type. |
||
246 | */ |
||
247 | public function getOutputFormat() |
||
251 | |||
252 | /** |
||
253 | * CLI output description. |
||
254 | * @return string description. |
||
255 | */ |
||
256 | public function getDescription() |
||
260 | |||
261 | /** |
||
262 | * Analyser instance. |
||
263 | * @return Analyser instance. |
||
264 | */ |
||
265 | public function getAnalyser() |
||
277 | |||
278 | /** |
||
279 | * List of output format classes. |
||
280 | * @return array array where the key is a format and its value the class. |
||
281 | */ |
||
282 | protected function getOutputFormatClasses() |
||
292 | |||
293 | /** |
||
294 | * Get argument value from user informed arguments. |
||
295 | * @param string $name argument name. |
||
296 | * @return Mixed argument value. |
||
297 | */ |
||
298 | protected function getArgumentValue($name) |
||
302 | |||
303 | /** |
||
304 | * Check if the user supplied an argument. |
||
305 | * @param string $name argument name. |
||
306 | * @return boolean if the argument has informed or not. |
||
307 | */ |
||
308 | protected function hasArgumentValue($name) |
||
312 | } |
||
313 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: