AbstractEnterprise::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace FlexyProject\GitHub\Receiver\Enterprise;
3
4
use FlexyProject\GitHub\AbstractApi;
5
use FlexyProject\GitHub\Receiver\Api;
6
use FlexyProject\GitHub\Receiver\Enterprise;
7
8
/**
9
 * Class AbstractEnterprise
10
 *
11
 * @package FlexyProject\GitHub\Receiver\Enterprise
12
 */
13
abstract class AbstractEnterprise
14
{
15
    /** Api trait */
16
    use Api;
17
18
    /** Properties */
19
    protected $enterprise;
20
21
    /**
22
     * Constructor
23
     *
24
     * @param Enterprise $enterprise
25
     */
26
    public function __construct(Enterprise $enterprise)
27
    {
28
        $this->setEnterprise($enterprise);
29
        $this->setApi($enterprise->getApi());
30
    }
31
32
    /**
33
     * Get enterprise
34
     *
35
     * @return Enterprise
36
     */
37
    public function getEnterprise(): Enterprise
38
    {
39
        return $this->enterprise;
40
    }
41
42
    /**
43
     * Set enterprise
44
     *
45
     * @param Enterprise $enterprise
46
     *
47
     * @return AbstractEnterprise
48
     */
49
    public function setEnterprise(Enterprise $enterprise): AbstractEnterprise
50
    {
51
        $this->enterprise = $enterprise;
52
53
        return $this;
54
    }
55
}