Completed
Push — master ( 627fdf...8ebf4e )
by Dmitry
04:12
created

Context   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 27
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A apply() 0 6 2
A getPerson() 0 4 2
1
<?php
2
3
namespace Basis;
4
5
use Carbon\Carbon;
6
7
class Context
8
{
9
    public $session;
10
    public $host;
11
    public $socket;
12
13
    public $gateway;
14
    public $gatewaySocket;
15
16
    public $company;
17
    public $module;
18
    public $person;
19
20
    public $parent;
21
22
    public function apply($data)
23
    {
24
        foreach ($data as $k => $v) {
25
            $this->$k = $v;
26
        }
27
    }
28
29
    public function getPerson()
30
    {
31
        return $this->parent ? $this->parent->person : $this->person;
32
    }
33
}
34