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 Postpay\Http; |
||
4 | |||
5 | class Url |
||
6 | { |
||
7 | /** |
||
8 | * Appends params to the URL. |
||
9 | * |
||
10 | * @param string $path The URL path that will receive the params. |
||
0 ignored issues
–
show
|
|||
11 | * @param array $params The params to append to the URL. |
||
12 | * |
||
13 | * @return string |
||
14 | */ |
||
15 | 4 | public static function addParamsToUrl($url, array $params = []) |
|
16 | { |
||
17 | 4 | if (empty($params)) { |
|
18 | 3 | return $url; |
|
19 | } |
||
20 | 1 | return $url . '?' . http_build_query($params, null, '&'); |
|
21 | } |
||
22 | |||
23 | /** |
||
24 | * Check for a "/" prefix and prepend it if not exists. |
||
25 | * |
||
26 | * @param string|null $string |
||
0 ignored issues
–
show
There is no parameter named
$string . Was it maybe removed?
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 /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not.
Loading history...
|
|||
27 | * |
||
28 | * @return string|null |
||
29 | */ |
||
30 | 5 | public static function slashPrefix($path) |
|
31 | { |
||
32 | 5 | return strpos($path, '/') === 0 ? $path : '/' . $path; |
|
33 | } |
||
34 | } |
||
35 |
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.