Passed
Pull Request — master (#840)
by Maxim
12:40 queued 05:56
created

BootloadManager::getClasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Boot\BootloadManager;
6
7
use Spiral\Core\InvokerInterface;
8
use Spiral\Core\ResolverInterface;
9
use Spiral\Core\ScopeInterface;
10
11
/**
12
 * @deprecated since v3.4. Use the {@see CustomizableBootloadManager} instead.
13
 */
14
final class BootloadManager extends AbstractBootloadManager
15
{
16
    private InvokerStrategyInterface $invokerStrategy;
17
18 1
    public function __construct(
19
        ScopeInterface $scope,
20
        private readonly InvokerInterface $invoker,
21
        private readonly ResolverInterface $resolver,
22
        InitializerInterface $initializer,
23
        ?InvokerStrategyInterface $invokerStrategy = null
24
    ) {
25 1
        parent::__construct($scope, $initializer);
26
27 1
        $this->invokerStrategy = $invokerStrategy ?? new DefaultStrategy(
28 1
            ...$this->resolver->resolveArguments((new \ReflectionClass(DefaultStrategy::class))->getConstructor())
29
        );
30
    }
31
32
    /**
33
     * Bootload all given bootloaders.
34
     *
35
     * @param array<class-string>|array<class-string, array<string,mixed>> $classes
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<class-string>|arra...g, array<string,mixed>> at position 2 could not be parsed: Unknown type name 'class-string' at position 2 in array<class-string>|array<class-string, array<string,mixed>>.
Loading history...
36
     *
37
     * @throws \Throwable
38
     */
39 1
    protected function boot(array $classes, array $bootingCallbacks, array $bootedCallbacks): void
40
    {
41 1
        $this->invokerStrategy->invokeBootloaders($classes, $bootingCallbacks, $bootedCallbacks);
42
    }
43
}
44