GithubRepoPermissions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace DevBoardLib\GithubCore\Repo;
4
5
/**
6
 * Class GithubRepoPermissions.
7
 */
8
class GithubRepoPermissions implements GithubRepoPermissonsInterface
9
{
10
    /** @var bool */
11
    private $admin;
12
    /** @var bool */
13
    private $push;
14
    /** @var bool */
15
    private $read;
16
17
    /**
18
     * GithubRepoPermissions constructor.
19
     *
20
     * @param bool $admin
21
     * @param bool $push
22
     * @param bool $read
23
     */
24
    public function __construct(bool $admin, bool $push, bool $read)
25
    {
26
        $this->admin = $admin;
27
        $this->push  = $push;
28
        $this->read  = $read;
29
    }
30
31
    /**
32
     * @return bool
33
     */
34
    public function isAdmin() : bool
35
    {
36
        return $this->admin;
37
    }
38
39
    /**
40
     * @return bool
41
     */
42
    public function isPushAllowed() : bool
43
    {
44
        return $this->push;
45
    }
46
47
    /**
48
     * @return bool
49
     */
50
    public function isReadAllowed() : bool
51
    {
52
        return $this->read;
53
    }
54
}
55