1 | <?php |
||
5 | class Stub |
||
6 | { |
||
7 | /** |
||
8 | * The stub path. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $path; |
||
13 | |||
14 | /** |
||
15 | * The base path of stub file. |
||
16 | * |
||
17 | * @var null|string |
||
18 | */ |
||
19 | protected static $basePath = null; |
||
20 | |||
21 | /** |
||
22 | * The replacements array. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $replaces = []; |
||
27 | |||
28 | /** |
||
29 | * Defines the style of variables in a file |
||
30 | * that will be replaced. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | 136 | protected $style; |
|
35 | |||
36 | 136 | /** |
|
37 | 136 | * The contructor. |
|
38 | 136 | * |
|
39 | * @param string $path |
||
40 | * @param array $replaces |
||
41 | */ |
||
42 | public function __construct($path, array $replaces = []) |
||
47 | |||
48 | 11 | /** |
|
49 | * Set variable style. |
||
50 | 11 | * |
|
51 | * @param string $style |
||
|
|||
52 | * @return self |
||
53 | */ |
||
54 | public function setStyle($left, $right = null) |
||
68 | |||
69 | /** |
||
70 | * Get variable style. |
||
71 | * |
||
72 | 135 | * @return string |
|
73 | */ |
||
74 | 135 | public function getStyle() |
|
78 | |||
79 | /** |
||
80 | * Create new self instance. |
||
81 | * |
||
82 | * @param string $path |
||
83 | * @param array $replaces |
||
84 | 230 | * |
|
85 | * @return self |
||
86 | 230 | */ |
|
87 | 230 | public static function create($path, array $replaces = []) |
|
91 | |||
92 | /** |
||
93 | * Set stub path. |
||
94 | 135 | * |
|
95 | * @param string $path |
||
96 | 135 | * |
|
97 | * @return self |
||
98 | */ |
||
99 | public function setPath($path) |
||
105 | |||
106 | 133 | /** |
|
107 | * Get stub path. |
||
108 | 133 | * |
|
109 | 133 | * @return string |
|
110 | */ |
||
111 | public function getPath() |
||
117 | |||
118 | /** |
||
119 | * Set base path. |
||
120 | 130 | * |
|
121 | * @param string $path |
||
122 | 130 | */ |
|
123 | public static function setBasePath($path) |
||
127 | |||
128 | /** |
||
129 | * Get base path. |
||
130 | * |
||
131 | * @return string|null |
||
132 | */ |
||
133 | 3 | public static function getBasePath() |
|
137 | |||
138 | /** |
||
139 | * Get stub contents. |
||
140 | * |
||
141 | * @return mixed|string |
||
142 | */ |
||
143 | public function getContents() |
||
154 | |||
155 | /** |
||
156 | * Get stub contents. |
||
157 | 2 | * |
|
158 | * @return string |
||
159 | 2 | */ |
|
160 | public function render() |
||
164 | |||
165 | /** |
||
166 | * Save stub to specific path. |
||
167 | 11 | * |
|
168 | * @param string $path |
||
169 | 11 | * @param string $filename |
|
170 | * |
||
171 | * @return bool |
||
172 | */ |
||
173 | public function saveTo($path, $filename) |
||
177 | |||
178 | /** |
||
179 | * Set replacements array. |
||
180 | * |
||
181 | * @param array $replaces |
||
182 | * |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function replace(array $replaces = []) |
||
191 | |||
192 | /** |
||
193 | * Get replacements. |
||
194 | * |
||
195 | * @return array |
||
196 | */ |
||
197 | public function getReplaces() |
||
201 | |||
202 | /** |
||
203 | * Handle magic method __toString. |
||
204 | * |
||
205 | * @return string |
||
206 | */ |
||
207 | public function __toString() |
||
211 | } |
||
212 |
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.