InteractiveChan   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 3 2
A chan() 0 3 1
A queued() 0 3 1
1
<?php
2
/**
3
 * Interactive channel
4
 * User: moyo
5
 * Date: 17/11/2017
6
 * Time: 3:41 PM
7
 */
8
9
namespace Carno\NSQ\Chips;
10
11
use Carno\Channel\Chan;
12
use Carno\Channel\Channel;
13
14
trait InteractiveChan
15
{
16
    /**
17
     * @var Chan
18
     */
19
    private $chan = null;
20
21
    /**
22
     * @return Chan
23
     */
24
    private function chan() : Chan
25
    {
26
        return $this->chan;
27
    }
28
29
    /**
30
     * @param int $queued
31
     */
32
    private function init(int $queued) : void
33
    {
34
        $queued && $this->chan = new Channel($queued);
35
    }
36
37
    /**
38
     * @return bool
39
     */
40
    private function queued() : bool
41
    {
42
        return !! $this->chan;
43
    }
44
}
45