Passed
Pull Request — master (#133)
by Timo
02:58
created

UrlHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A prependSlash() 0 3 1
A removeTrailingSlash() 0 3 1
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Helpers;
4
5
class UrlHelper
6
{
7 35
    public static function removeTrailingSlash(string $path): string
8
    {
9 35
        return \rtrim($path, '/');
10
    }
11
12 21
    public static function prependSlash(string $path): string
13
    {
14 21
        return '/' . \ltrim($path, '/');
15
    }
16
}
17