Connection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A confirm() 0 4 1
A __construct() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of the Tidal/WampWatch package.
5
 *   (c) 2016 Timo Michna <timomichna/yahoo.de>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 *
10
 */
11
12
namespace Tidal\WampWatch\Model;
13
14
use Tidal\WampWatch\Model\Property\Object\HasRouterTrait;
15
use Tidal\WampWatch\Model\Property\Object\HasRealmTrait;
16
use Tidal\WampWatch\Model\Property\Object\HasSessionTrait;
17
18
class Connection implements Contract\ConnectionInterface
19
{
20
    use HasRouterTrait;
21
    use HasRealmTrait;
22
    use HasSessionTrait;
23
24
    public function __construct(Contract\RouterInterface $router,
25
                                Contract\RealmInterface $realm,
26
                                Contract\SessionInterface $session = null
27
    ) {
28
        $this->setRouter($router);
29
        $this->setRealm($realm);
30
        if ($session !== null) {
31
            $this->confirm($session);
32
        }
33
    }
34
35
    public function confirm(Contract\SessionInterface $session)
36
    {
37
        $this->setSession($session);
38
    }
39
}
40