GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b864c9...ed9166 )
by butschster
12:41
created

ModelCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A aliases() 0 6 1
A keyByAlias() 0 6 1
1
<?php
2
3
namespace SleepingOwl\Admin\Model;
4
5
use Illuminate\Support\Collection;
6
use SleepingOwl\Admin\Contracts\ModelConfigurationInterface;
7
8
class ModelCollection extends Collection
9
{
10
    /**
11
     * @return static
12
     */
13
    public function aliases()
14
    {
15
        return $this->map(function (ModelConfigurationInterface $model) {
16
            return $model->getAlias();
17
        });
18
    }
19
20
    /**
21
     * @return static
22
     */
23
    public function keyByAlias()
24
    {
25 285
        return $this->keyBy(function (ModelConfigurationInterface $model) {
26
            return $model->getAlias();
27 285
        });
28
    }
29
}
30