ShiftDataValueCommand::exec()   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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\UniLex\Example\Brainfuck\Command;
6
7
use Remorhaz\UniLex\Example\Brainfuck\Exception;
8
use Remorhaz\UniLex\Example\Brainfuck\Runtime;
9
10
class ShiftDataValueCommand extends AbstractCommand
11
{
12
    private $value;
13
14
    public function __construct(Runtime $runtime, int $value)
15
    {
16
        parent::__construct($runtime);
17
        $this->value = $value;
18
    }
19
20
    /**
21
     * @throws Exception
22
     */
23
    public function exec(): void
24
    {
25
        $this->runtime->shiftDataValue($this->value);
26
        $this->runtime->shiftCommandIndex(1);
27
    }
28
}
29