Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait AttachDaftFramework |
||
12 | { |
||
13 | /** |
||
14 | * @var Framework|null |
||
15 | */ |
||
16 | protected $daftFrameworkInstance; |
||
17 | |||
18 | 2 | public function AttachDaftFramework(Framework $framework) : void |
|
19 | { |
||
20 | 2 | if ($this->daftFrameworkInstance instanceof Framework) { |
|
21 | 1 | throw new BadMethodCallException( |
|
22 | 1 | 'Framework must not be attached if a framework is already attached!' |
|
23 | ); |
||
24 | } |
||
25 | |||
26 | 2 | $this->daftFrameworkInstance = $framework; |
|
27 | 2 | } |
|
28 | |||
29 | 2 | public function DetachDaftFramework() : ? Framework |
|
38 | } |
||
39 | |||
40 | 2 | public function GetDaftFramework() : ? Framework |
|
43 | } |
||
44 | |||
45 | 1 | public function CheckIfUsingFrameworkInstance(Framework ...$instances) : bool |
|
50 |