Completed
Push — master ( b1d0ff...f51f35 )
by Toni
04:43
created

Player   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isLeader() 0 4 1
A isCoLeader() 0 4 1
A isElder() 0 4 1
1
<?php
2
3
4
namespace ClashOfClans\Api\Clan;
5
6
7
use ClashOfClans\Api\AbstractResource;
8
use ClashOfClans\Api\League\League;
9
10
/**
11
 * @method string name()
12
 * @method string role()
13
 * @method int expLevel()
14
 * @method League league()
15
 * @method int trophies()
16
 * @method int clanRank()
17
 * @method int previousClanRank()
18
 * @method int donations()
19
 * @method int donationsReceived()
20
 * @method Clan clan()
21
 */
22
class Player extends AbstractResource
23
{
24
    protected $casts = [
25
        'league' => League::class,
26
        'clan' => Clan::class
27
    ];
28
29
    public function isLeader()
30
    {
31
        return $this->role() === 'leader';
32
    }
33
34
    public function isCoLeader()
35
    {
36
        return $this->role() === 'coLeader';
37
    }
38
39
    public function isElder()
40
    {
41
        return $this->role() === 'admin';
42
    }
43
}
44