PsiOptions::setFactory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * File was created 12.06.2015 09:51
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi;
9
10
/**
11
 * @author Karsten J. Gerber <[email protected]>
12
 */
13
class PsiOptions
14
{
15
    /** @var PsiFactory */
16
    private $factory;
17
    /** @var bool */
18
    private $preserveKeysOfMultipleInputs = false;
19
20 145
    public function __construct()
21
    {
22 145
        $this->factory = new DefaultPsiFactory();
23 145
    }
24
25
    /**
26
     * @return PsiFactory
27
     */
28 131
    public function getFactory()
29
    {
30 131
        return $this->factory;
31
    }
32
33
    /**
34
     * @param PsiFactory $factory
35
     *
36
     * @return $this
37
     */
38 1
    public function setFactory(PsiFactory $factory)
39
    {
40 1
        $this->factory = $factory;
41
42 1
        return $this;
43
    }
44
45
    /**
46
     * @return boolean
47
     */
48 16
    public function isPreserveKeysOfMultipleInputs()
49
    {
50 16
        return $this->preserveKeysOfMultipleInputs;
51
    }
52
53
    /**
54
     * @param boolean $preserveKeysOfMultipleInputs
55
     *
56
     * @return $this
57
     */
58 4
    public function setPreserveKeysOfMultipleInputs($preserveKeysOfMultipleInputs)
59
    {
60 4
        $this->preserveKeysOfMultipleInputs = $preserveKeysOfMultipleInputs;
61
62 4
        return $this;
63
    }
64
}
65