Player::isLeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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