CommandResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 2
b 0
f 0
dl 0
loc 26
ccs 0
cts 9
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrors() 0 3 1
A getStatus() 0 3 1
A getResult() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Api\Inspector;
6
7
class CommandResponse
8
{
9
    public const STATUS_OK = 'ok';
10
    public const STATUS_ERROR = 'error';
11
    public const STATUS_FAIL = 'fail';
12
13
    public function __construct(
14
        private string $status,
15
        private mixed $result,
16
        private array $errors = [],
17
    ) {
18
    }
19
20
    public function getStatus(): string
21
    {
22
        return $this->status;
23
    }
24
25
    public function getResult(): mixed
26
    {
27
        return $this->result;
28
    }
29
30
    public function getErrors(): array
31
    {
32
        return $this->errors;
33
    }
34
}
35