Passed
Pull Request — main (#20)
by Chema
12:14 queued 10:21
created

Inject::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 0
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Container\Attribute;
6
7
use Attribute;
8
9
/**
10
 * Marks a constructor parameter for dependency injection.
11
 * Optionally specifies which concrete implementation to inject.
12
 */
13
#[Attribute(Attribute::TARGET_PARAMETER)]
14
final class Inject
15
{
16
    /**
17
     * @param class-string|null $implementation The specific implementation to inject
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string|null at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string|null.
Loading history...
18
     */
19 3
    public function __construct(
20
        public ?string $implementation = null,
21
    ) {
22 3
    }
23
}
24