ADriverProviderFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlecRabbit\Spinner\Core\Factory\A;
6
7
use AlecRabbit\Spinner\Core\Contract\IDriverProvider;
8
use AlecRabbit\Spinner\Core\Contract\IDriverSetup;
9
use AlecRabbit\Spinner\Core\DriverProvider;
0 ignored issues
show
Bug introduced by
The type AlecRabbit\Spinner\Core\DriverProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use AlecRabbit\Spinner\Core\Factory\Contract\IDriverFactory;
11
use AlecRabbit\Spinner\Core\Factory\Contract\IDriverProviderFactory;
12
13
abstract class ADriverProviderFactory implements IDriverProviderFactory
14
{
15
    public function __construct(
16
        protected IDriverFactory $driverFactory,
17
        protected IDriverSetup $driverSetup,
18
    ) {
19
    }
20
21
    public function create(): IDriverProvider
22
    {
23
        $driver = $this->driverFactory->create();
24
25
        $driverProvider =
26
            new DriverProvider(
27
                driver: $driver,
28
            );
29
30
        $this->driverSetup->setup($driver);
31
32
        return $driverProvider;
33
    }
34
}
35