GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 504c99...f9b5ba )
by Sebastian
03:20
created

Url::stripTrailingSlashes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Menu\Helpers;
4
5
class Url
6
{
7
    public static function stripTrailingSlashes(string $url): string
8
    {
9
        return rtrim($url, '/');
10
    }
11
12
    public static function parts(string $url): array
13
    {
14
        $url = parse_url(self::stripTrailingSlashes($url, '/'));
0 ignored issues
show
Unused Code introduced by
The call to Url::stripTrailingSlashes() has too many arguments starting with '/'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
15
16
        return [
17
            'host' => $url['host'] ?? '',
18
            'path' => $url['path'] ?? '',
19
        ];
20
    }
21
}
22