Completed
Push — 1.x ( 9fb4e6...0dadb1 )
by Akihito
20s queued 16s
created

FastlyModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\QueryRepository\Cdn;
6
7
use BEAR\FastlyModule\FastlyPurgeModule;
8
use BEAR\QueryRepository\CdnCacheControlHeaderSetterInterface;
9
use BEAR\QueryRepository\PurgerInterface;
10
use Ray\Di\AbstractModule;
11
12
final class FastlyModule extends AbstractModule
13
{
14
    public function __construct(
15
        private string $fastlyApiKey,
16
        private string $fastlyServiceId,
17
        AbstractModule|null $module = null,
18
    ) {
19
        parent::__construct($module);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function configure(): void
26
    {
27
        $this->install(new FastlyPurgeModule($this->fastlyApiKey, $this->fastlyServiceId));
28
        $this->bind(CdnCacheControlHeaderSetterInterface::class)->to(FastlyCacheControlHeaderSetter::class);
0 ignored issues
show
Bug introduced by
The type BEAR\QueryRepository\Cdn...acheControlHeaderSetter 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...
29
        $this->bind(PurgerInterface::class)->to(FastlyCachePurger::class);
30
    }
31
}
32