Completed
Push — master ( 9e1ab8...e0f7b9 )
by Bill
04:14 queued 02:03
created

ResultCollection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A orderByScoreDesc() 0 6 1
1
<?php declare(strict_types = 1);
2
3
namespace Churn\Results;
4
5
use Illuminate\Support\Collection;
6
7
class ResultCollection extends Collection
8
{
9
    /**
10
     * Order results by their score in descending order.
11
     * @return self
12
     */
13
    public function orderByScoreDesc(): self
14
    {
15
        return $this->sortByDesc(function ($result) {
16
            return $result->getScore();
17
        });
18
    }
19
}
20