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   C
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 31

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 3
c 4
b 1
f 1
lcom 1
cbo 31
dl 0
loc 62
ccs 38
cts 38
cp 1
rs 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 33 1
A find() 0 6 1
A findByName() 0 6 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