Completed
Push — master ( 26e625...88c602 )
by Timo
02:58
created

Connection::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 3
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, Contract\RealmInterface $realm, Contract\SessionInterface $session = null)
25
    {
26
        $this->setRouter($router);
27
        $this->setRealm($realm);
28
        if ($session !== null) {
29
            $this->confirm($session);
30
        }
31
    }
32
33
    public function confirm(Contract\SessionInterface $session)
34
    {
35
        $this->setSession($session);
36
    }
37
}
38