Completed
Push — develop ( ad187c...f818a7 )
by Jaap
09:04
created

Interpret   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 59
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A subject() 0 4 1
A interpreter() 0 4 1
A context() 0 4 1
A usingInterpreter() 0 6 1
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2015 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Application\ReadModel\Mapper\Project;
14
15
use phpDocumentor\DomainModel\ReadModel\Mapper\Project\Interpret as InterpretInterface;
16
use phpDocumentor\DomainModel\ReadModel\Mapper\Project\Interpreter;
17
use phpDocumentor\Reflection\Types\Context;
18
19
final class Interpret implements InterpretInterface
20
{
21
    /** @var mixed */
22
    private $subject;
23
24
    /** @var Interpreter|null */
25
    private $interpreter;
26
27
    /** @var Context */
28
    private $context;
29
30
    /**
31
     * InterpretCommand constructor.
32
     *
33
     * @param mixed $subject
34
     * @param Context $withContext
35
     */
36
    public function __construct($subject, Context $withContext = null)
37
    {
38
        $this->subject = $subject;
39
        $this->context = $withContext;
40
    }
41
42
    /**
43
     * @return mixed
44
     */
45
    public function subject()
46
    {
47
        return $this->subject;
48
    }
49
50
    /**
51
     * @return Interpreter|null
52
     */
53
    public function interpreter()
54
    {
55
        return $this->interpreter;
56
    }
57
58
    /**
59
     * @return Context
60
     */
61
    public function context()
62
    {
63
        return $this->context;
64
    }
65
66
    /**
67
     * @param Interpreter $interpreter
68
     *
69
     * @return Interpret
70
     */
71
    public function usingInterpreter(Interpreter $interpreter)
72
    {
73
        $command = clone $this;
74
        $command->interpreter = $interpreter;
75
        return $command;
76
    }
77
}
78