Completed
Push — master ( 421969...277b3a )
by Dani
01:04
created

src/Http/Url.php (2 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

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
There is no parameter named $path. 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 $italy is not defined by the method finale(...).

/**
 * @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...
11
     * @param array  $params The params to append to the URL.
12
     *
13
     * @return string
14
     */
15
    public static function addParamsToUrl($url, array $params = [])
16
    {
17
        if (empty($params)) {
18
            return $url;
19
        }
20
        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 $italy is not defined by the method finale(...).

/**
 * @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
    public static function slashPrefix($path)
31
    {
32
        return strpos($path, '/') === 0 ? $path : '/' . $path;
33
    }
34
}
35