Passed
Branch 001-basic (dcea18)
by Mr.
07:50
created

Error   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LibraryCatalog\Controller\V1\ValueObject;
6
7
class Error
8
{
9
    /** @var string */
10
    public string $message;
11
    /** @var string */
12
    public string $code;
13
14
    /**
15
     * @param string $message
16
     * @param string $code
17
     * @return Error
18
     */
19 10
    public static function create(string $message, string $code = ''): Error
20
    {
21 10
        $object = new static();
22 10
        $object->message = _($message);
23 10
        $object->code = $code;
24
25 10
        return $object;
26
    }
27
}
28