Url   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

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