Passed
Push — master ( 7bd689...ed0e19 )
by butschster
16:50 queued 18s
created

Scope::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 5
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core;
6
7
/**
8
 * DTO to define Container Scope.
9
 *
10
 * @psalm-import-type TResolver from BinderInterface
11
 *
12
 * @internal We are testing this feature, it may be changed in the future.
13
 */
14
final class Scope
15
{
16
    /**
17
     * @param null|string $name Scope name. Named scopes can have individual bindings and constrains.
18
     * @param array<non-empty-string, TResolver> $bindings Custom bindings for the new scope.
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<non-empty-string, TResolver> at position 2 could not be parsed: Unknown type name 'non-empty-string' at position 2 in array<non-empty-string, TResolver>.
Loading history...
19
     * @param bool $autowire If {@see false}, closure will be invoked with just only the passed Container
20
     *        as the first argument. Otherwise, {@see InvokerInterface::invoke()} will be used to invoke the closure.
21
     */
22 34
    public function __construct(
23
        public readonly ?string $name = null,
24
        public readonly array $bindings = [],
25
        public readonly bool $autowire = true,
26
    ) {
27 34
    }
28
}
29