Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4.016 |
Changes | 0 |
1 | <?php |
||
51 | 154 | public function operation(Operation $operation) |
|
52 | { |
||
53 | 154 | if ($this->done) { |
|
54 | throw new \RuntimeException("Cannot add operation to finished PathTracer"); |
||
55 | } |
||
56 | |||
57 | 154 | if ($operation->isLogical()) { |
|
58 | // Logical opcodes mean the end of a segment |
||
59 | 32 | if (count($this->current) > 0) { |
|
60 | 32 | $this->makeSegment(); |
|
61 | } |
||
62 | |||
63 | 32 | $this->addToCurrent($operation); |
|
64 | 32 | $this->makeSegment(); |
|
65 | } else { |
||
66 | 154 | $this->addToCurrent($operation); |
|
67 | } |
||
68 | 154 | } |
|
69 | |||
88 |