1 | <?php |
||
8 | class CommandToExec |
||
9 | { |
||
10 | protected $execPath; |
||
11 | protected $arguments; |
||
12 | protected $env; |
||
13 | protected $dir; |
||
14 | |||
15 | /** |
||
16 | * Hold some command values to later exec |
||
17 | */ |
||
18 | public function __construct($execPath, $arguments, $env = array(), $dir = '') |
||
25 | |||
26 | /** |
||
27 | * Generate a single command string. |
||
28 | */ |
||
29 | public function getCommandString() |
||
39 | |||
40 | /** |
||
41 | * Run our command. Set up the environment, as needed, ensuring that |
||
42 | * it is restored at the end of the run. |
||
43 | */ |
||
44 | public function run($stdoutFile = '') |
||
55 | |||
56 | /** |
||
57 | * Run a single command. |
||
58 | * |
||
59 | * @param string $commandString |
||
60 | * @return integer |
||
61 | */ |
||
62 | public static function runCommand($commandString, $stdoutFile = '') |
||
75 | } |
||
76 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.