Player   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

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