Completed
Push — IncomprehensibleFinder/marcos ( 3df5a7 )
by Marcos
05:21 queued 03:01
created

SortFurthest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 2
1
<?php
2
3
namespace Kata\Algorithm;
4
5
final class SortFurthest
6
{
7 2
    public function __invoke($current_couple, $first_couple)
8
    {
9 2
        if ($current_couple->age_difference > $first_couple->age_difference)
10
        {
11
            $first_couple = $current_couple;
12
        }
13
14 2
        return $first_couple;
15
    }
16
}
17