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::keyByAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 2
cts 3
cp 0.6667
crap 1.037
rs 9.4285
c 0
b 0
f 0
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