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.

Repository::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Burthorpe\Runescape\RS3\Skills;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Support\Collection;
7
8
class Repository extends Collection
9
{
10 13
    public function __construct()
11
    {
12 13
        parent::__construct([
13 13
            new Overall(),
14 13
            new Attack(),
15 13
            new Defence(),
16 13
            new Strength(),
17 13
            new Constitution(),
18 13
            new Ranged(),
19 13
            new Prayer(),
20 13
            new Magic(),
21 13
            new Cooking(),
22 13
            new Woodcutting(),
23 13
            new Fletching(),
24 13
            new Fishing(),
25 13
            new Firemaking(),
26 13
            new Crafting(),
27 13
            new Smithing(),
28 13
            new Mining(),
29 13
            new Herblore(),
30 13
            new Agility(),
31 13
            new Thieving(),
32 13
            new Slayer(),
33 13
            new Farming(),
34 13
            new Runecrafting(),
35 13
            new Hunter(),
36 13
            new Construction(),
37 13
            new Summoning(),
38 13
            new Dungeoneering(),
39 13
            new Divination(),
40 13
            new Invention(),
41 13
        ]);
42 13
    }
43
44
    /**
45
     * Find a skill by its ID
46
     *
47
     * @param $id
48
     * @return \Burthorpe\Runescape\RS3\Skills\Contract|null
49
     */
50 5
    public function find($id)
51
    {
52
        return Arr::first($this->items, function ($key, Contract $skill) use ($id) {
53 5
            return $skill->getId() === $id;
54 5
        }, null);
55
    }
56
57
    /**
58
     * Find a skill by its name
59
     *
60
     * @param $name
61
     * @return \Burthorpe\Runescape\RS3\Skills\Contract|null
62
     */
63
    public function findByName($name)
64
    {
65 1
        return Arr::first($this->items, function ($key, Contract $skill) use ($name) {
66 1
            return $skill->getName() === strtolower($name);
67 1
        }, null);
68
    }
69
}
70