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

AbstractMethod   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 1
c 1
b 0
f 0
dl 0
loc 17
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 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