These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Deployer\Component\PharUpdate\Exception; |
||
4 | |||
5 | /** |
||
6 | * Provides additional functional to the Exception class. |
||
7 | * |
||
8 | * @author Kevin Herrera <[email protected]> |
||
9 | */ |
||
10 | class Exception extends \Exception implements ExceptionInterface |
||
11 | { |
||
12 | /** |
||
13 | * Creates a new exception using a format and values. |
||
14 | * |
||
15 | * @param string $format The format. |
||
16 | * @param mixed $value,... The value(s). |
||
0 ignored issues
–
show
|
|||
17 | * |
||
18 | * @return Exception The exception. |
||
19 | */ |
||
20 | public static function create($format, $value = null) |
||
21 | { |
||
22 | if (0 < func_num_args()) { |
||
23 | $format = vsprintf($format, array_slice(func_get_args(), 1)); |
||
24 | } |
||
25 | |||
26 | return new static($format); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Creates an exception for the last error message. |
||
31 | * |
||
32 | * @return Exception The exception. |
||
33 | */ |
||
34 | public static function lastError() |
||
35 | { |
||
36 | $error = error_get_last(); |
||
37 | |||
38 | return new static($error['message']); |
||
39 | } |
||
40 | } |
||
41 |
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.