1 | <?php |
||
10 | abstract class BaseOptimizer implements Optimizer |
||
11 | { |
||
12 | public $options = []; |
||
13 | |||
14 | public $imagePath = ''; |
||
15 | |||
16 | /** |
||
17 | * List of binary paths to check for commands. |
||
18 | * @var array $binaryPathList |
||
19 | */ |
||
20 | protected $binaryPathList = [ |
||
21 | '/usr/local', |
||
22 | '/usr/local/bin', |
||
23 | '/usr/bin', |
||
24 | '/usr/sbin', |
||
25 | '/usr/local/bin', |
||
26 | '/usr/local/sbin', |
||
27 | '/bin', |
||
28 | '/sbin' |
||
29 | ]; |
||
30 | |||
31 | /** @var \Psr\Log\LoggerInterface */ |
||
32 | protected $logger; |
||
33 | |||
34 | /** |
||
35 | * Binary name of the optimizer. |
||
36 | * @var string $binaryName |
||
37 | */ |
||
38 | protected $binaryName; |
||
39 | |||
40 | /** |
||
41 | * Binary path. |
||
42 | * |
||
43 | * @var string $binaryPath |
||
44 | */ |
||
45 | protected $binaryPath = ''; |
||
46 | |||
47 | public function __construct($options = []) |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Set binary Path |
||
56 | * |
||
57 | * Useful in case your commands are not accessible by global environment. ex. /usr/bin/local |
||
58 | * |
||
59 | * @param string $binaryName |
||
|
|||
60 | * @return string |
||
61 | */ |
||
62 | public function setBinaryPath(string $binaryPath) |
||
68 | |||
69 | /** |
||
70 | * Get binary path |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function binaryPath(): string |
||
78 | |||
79 | |||
80 | public function binaryName(): string |
||
84 | |||
85 | public function setImagePath(string $imagePath) |
||
91 | |||
92 | public function setOptions(array $options = []) |
||
98 | |||
99 | public function useLogger(LoggerInterface $log) |
||
105 | |||
106 | |||
107 | /** |
||
108 | * Get Binary path list |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function binaryPathList(){ |
||
115 | |||
116 | /** |
||
117 | * Authomatically detect the path where the image optimizes is installed |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function detectBinaryPath(){ |
||
153 | |||
154 | public function getCommand(): string |
||
161 | } |
||
162 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.