Emitter::hasEmitter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace nyx\events\awareness\traits;
2
3
// Internal dependencies
4
use nyx\events\awareness;
5
use nyx\events\interfaces;
6
7
/**
8
 * Event Emitter Awareness Trait
9
 *
10
 * @version     0.1.0
11
 * @author      Michal Chojnacki <[email protected]>
12
 * @copyright   2012-2017 Nyx Dev Team
13
 * @link        https://github.com/unyx/nyx
14
 */
15
trait Emitter
16
{
17
    /**
18
     * @var interfaces\Emitter  The Event Emitter in use by the exhibitor of this trait.
19
     */
20
    private $emitter;
21
22
    /**
23
     * @see \nyx\events\awareness\Emitter::getEmitter()
24
     */
25
    public function getEmitter() : ?interfaces\Emitter
26
    {
27
        return $this->emitter;
28
    }
29
30
    /**
31
     * @see \nyx\events\awareness\Emitter::setEmitter()
32
     */
33
    public function setEmitter(interfaces\Emitter $emitter) : awareness\Emitter
34
    {
35
        $this->emitter = $emitter;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @see \nyx\events\awareness\Emitter::hasEmitter()
42
     */
43
    public function hasEmitter() : bool
44
    {
45
        return isset($this->emitter);
46
    }
47
}
48