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   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A stripTrailingSlashes() 0 4 1
A parts() 0 9 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