Passed
Push — master ( e7e3c4...d0e289 )
by Rogier
01:26
created

Url   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A extractId() 0 11 2
1
<?php
2
3
namespace Rogierw\RwAcme\Support;
4
5
class Url
6
{
7
    public static function extractId(string $url): string
8
    {
9
        if (empty($url)) {
10
            return '';
11
        }
12
13
        $url = rtrim($url, '/');
14
15
        $positionLastSlash = strrpos($url, '/');
16
17
        return substr($url, ($positionLastSlash + 1));
18
    }
19
}
20