Passed
Push — feature/second-release ( e64b84...683aeb )
by Andrea Marco
02:47
created

Annotator::annotate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 26
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 3
eloc 16
c 3
b 0
f 0
nc 3
nop 2
dl 0
loc 26
ccs 18
cts 18
cp 1
crap 3
rs 9.7333
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cerbero\LaravelEnum\Services;
6
7
use Cerbero\Enum\Services\Annotator as BaseAnnotator;
8
9
/**
10
 * The enums annotator.
11
 *
12
 * @template TEnum of \UnitEnum
13
 *
14
 * @extends BaseAnnotator<TEnum>
15
 */
16
final class Annotator extends BaseAnnotator
17
{
18
    /**
19
     * Instantiate the class.
20
     *
21
     * @param class-string<TEnum> $enum
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<TEnum> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<TEnum>.
Loading history...
22
     * @throws \InvalidArgumentException
23
     */
24 2
    public function __construct(protected string $enum)
25
    {
26 2
        $this->inspector = new Inspector($enum);
27
    }
28
}
29