Passed
Push — master ( 477224...3259b8 )
by Aleksei
06:12 queued 18s
created

AbstractMethod::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 11
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Boot\Attribute;
6
7
/**
8
 * Abstract base class for method attributes used in bootloaders.
9
 * 
10
 * This abstract class serves as a base for all method-level attributes in the bootloader system,
11
 * providing common functionality for managing binding aliases.
12
 *
13
 * @internal This class is for internal use within the framework and should not be used directly by application code.
14
 */
15
abstract class AbstractMethod
16
{
17
    /**
18
     * @param non-empty-string|null $alias Alias for the method. If not provided, the return type of the method will be used as the alias.
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string|null at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string|null.
Loading history...
19
     * @param bool $aliasesFromReturnType Add aliases from the return type of the method even if the method has an alias.
20
     */
21 12
    public function __construct(
22
        /**
23
         * Alias for the method.
24
         * If not provided, the return type of the method will be used as the alias.
25
         */
26
        public readonly ?string $alias = null,
27
        /**
28
         * Add aliases from the return type of the method even if the method has an alias.
29
         */
30
        public readonly bool $aliasesFromReturnType = false,
31 12
    ) {}
32
}
33