SetCommandIndexCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
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 3 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 SetCommandIndexCommand extends AbstractCommand
11
{
12
    private $commandIndex;
13
14
    public function __construct(Runtime $runtime, int $index)
15
    {
16
        parent::__construct($runtime);
17
        $this->commandIndex = $index;
18
    }
19
20
    /**
21
     * @throws Exception
22
     */
23
    public function exec(): void
24
    {
25
        $this->runtime->setCommandIndex($this->commandIndex);
26
    }
27
}
28