ADriverProviderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 12 1
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