Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
33 | function http_build_url ($url, $parts) { |
||
34 | $url = explode('?', $url, 2); |
||
35 | $params = []; |
||
36 | if (isset($url[1])) { |
||
37 | foreach (explode('&', $url[1]) as $u) { |
||
38 | $params[] = $u; |
||
39 | } |
||
40 | unset($u, $url[1]); |
||
41 | } |
||
42 | $url = $url[0]; |
||
43 | foreach ($parts as $name => $value) { |
||
44 | $params[] = $name.'='.urlencode($value); |
||
45 | } |
||
46 | unset($parts, $p); |
||
47 | $params = array_unique($params); |
||
48 | return "$url?".implode('&', $params); |
||
49 | } |
||
50 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type
array
and suggests a stricter type likearray<String>
.Most often this is a case of a parameter that can be null in addition to its declared types.