Completed
Push — refactoring ( 84ac1f...ab1ebc )
by Oleg
04:25
created

IsUrlEqual   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 18
wmc 2
lcom 1
cbo 0
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isUrlEqual() 0 9 2
1
<?php
2
3
namespace Malezha\Menu\Traits;
4
5
trait IsUrlEqual
6
{
7
    protected $uriForTrim = [
8
        '#',
9
        '/index',
10
        '/'
11
    ];
12
13 4
    public function isUrlEqual($first, $second)
14
    {
15 4
        foreach ($this->uriForTrim as $trim) {
16 4
            $first = rtrim($first, $trim);
17 4
            $second = rtrim($second, $trim);
18 4
        }
19
20 4
        return $first == $second;
21
    }
22
}