1 | <?php |
||
17 | class Process |
||
18 | { |
||
19 | /** |
||
20 | * List of system commands to execute. |
||
21 | * |
||
22 | * @var array<\phpbu\Backup\Cli\Cmd> |
||
23 | */ |
||
24 | private $commands = []; |
||
25 | |||
26 | /** |
||
27 | * Redirect the output |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private $redirectOutput; |
||
32 | |||
33 | /** |
||
34 | * Redirect the stdOut. |
||
35 | * |
||
36 | * @param string $path |
||
37 | */ |
||
38 | 12 | public function redirectOutputTo($path) |
|
42 | |||
43 | /** |
||
44 | * Should the output be redirected. |
||
45 | * |
||
46 | * @return boolean |
||
47 | */ |
||
48 | 1 | public function isOutputRedirected() |
|
52 | |||
53 | /** |
||
54 | * Redirect getter. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function getRedirectPath() |
|
62 | |||
63 | /** |
||
64 | * Adds a cli command to the command list. |
||
65 | * |
||
66 | * @param \phpbu\App\Cli\Cmd $cmd |
||
67 | */ |
||
68 | 99 | public function addCommand(Cmd $cmd) |
|
72 | |||
73 | /** |
||
74 | * Generates the system command. |
||
75 | * |
||
76 | * @return string |
||
77 | * @throws \phpbu\App\Exception |
||
78 | */ |
||
79 | 97 | public function getCommandLine() |
|
90 | |||
91 | /** |
||
92 | * Executes the commands. |
||
93 | * |
||
94 | * @return \phpbu\App\Cli\Result |
||
95 | * @throws \phpbu\App\Exception |
||
96 | */ |
||
97 | 1 | public function run() |
|
124 | } |
||
125 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.