Completed
Push — master ( 8cac34...b87516 )
by Viacheslav
07:08 queued 03:36
created

State::makeAnchor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Yaoi\Command;
4
5
use Yaoi\BaseClass;
6
7
class State extends BaseClass
8
{
9
    public $commandClass;
10
    private $properties = array();
11
    /** @var Io */
12
    private $io;
13
14
    public function setIo(Io $io = null)
15
    {
16
        $this->io = $io;
17
        return $this;
18
    }
19
20
    public function makeAnchor()
21
    {
22
        return $this->io->makeAnchor($this);
23
    }
24
25
    public function __get($name)
26
    {
27
        return isset($this->properties[$name]) ? $this->properties[$name] : null;
28
    }
29
30
    public function __set($name, $value)
31
    {
32
        $this->properties[$name] = $value;
33
    }
34
35
    public function hasProperty($name)
36
    {
37
        return array_key_exists($name, $this->properties);
38
    }
39
40
41
    public function export()
42
    {
43
        return $this->properties;
44
    }
45
46
}