ShiftDataIndexCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A exec() 0 4 1
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 ShiftDataIndexCommand extends AbstractCommand
11
{
12
    private $dataIndex;
13
14
    public function __construct(Runtime $runtime, int $index)
15
    {
16
        parent::__construct($runtime);
17
        $this->dataIndex = $index;
18
    }
19
20
    /**
21
     * @throws Exception
22
     */
23
    public function exec(): void
24
    {
25
        $this->runtime->shiftDataIndex($this->dataIndex);
26
        $this->runtime->shiftCommandIndex(1);
27
    }
28
}
29