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

Player::isCoLeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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