CliModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Package\Context;
6
7
use BEAR\Package\Annotation\StdIn;
8
use BEAR\Package\Provide\Router\CliRouter;
9
use BEAR\Package\Provide\Transfer\CliResponder;
10
use BEAR\QueryRepository\CliHttpCache;
0 ignored issues
show
Bug introduced by
The type BEAR\QueryRepository\CliHttpCache 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...
11
use BEAR\Sunday\Extension\Router\RouterInterface;
12
use BEAR\Sunday\Extension\Transfer\HttpCacheInterface;
13
use BEAR\Sunday\Extension\Transfer\TransferInterface;
14
use Override;
15
use Ray\Di\AbstractModule;
16
17
use function crc32;
18
use function sys_get_temp_dir;
19
use function tempnam;
20
21
final class CliModule extends AbstractModule
22
{
23
    /**
24
     * {@inheritDoc}
25
     */
26
    #[Override]
27
    protected function configure(): void
28
    {
29
        $this->rename(RouterInterface::class, 'original');
30
        $this->bind(RouterInterface::class)->to(CliRouter::class);
31
        $this->bind(TransferInterface::class)->to(CliResponder::class);
32
        $this->bind(HttpCacheInterface::class)->to(CliHttpCache::class);
33
        $stdIn = tempnam(sys_get_temp_dir(), 'stdin-' . crc32(__FILE__));
34
        $this->bind()->annotatedWith(StdIn::class)->toInstance($stdIn);
35
    }
36
}
37