ResourceClientModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 22
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 25
rs 9.568
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Module;
6
7
use BEAR\Resource\Anchor;
8
use BEAR\Resource\AnchorInterface;
9
use BEAR\Resource\DataLoader\DataLoader;
10
use BEAR\Resource\ExtraMethodInvoker;
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\ExtraMethodInvoker 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\Resource\Factory;
12
use BEAR\Resource\FactoryInterface;
13
use BEAR\Resource\HalLink;
14
use BEAR\Resource\HalLinker;
15
use BEAR\Resource\Invoker;
16
use BEAR\Resource\InvokerInterface;
17
use BEAR\Resource\Linker;
18
use BEAR\Resource\LinkerInterface;
19
use BEAR\Resource\LoggerInterface;
20
use BEAR\Resource\NamedParameter;
21
use BEAR\Resource\NamedParameterInterface;
22
use BEAR\Resource\NamedParamMetas;
23
use BEAR\Resource\NamedParamMetasInterface;
24
use BEAR\Resource\NullLogger;
25
use BEAR\Resource\NullReverseLink;
26
use BEAR\Resource\NullReverseLinker;
27
use BEAR\Resource\OptionsMethods;
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\OptionsMethods 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...
28
use BEAR\Resource\OptionsRenderer;
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\OptionsRenderer 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
use BEAR\Resource\PhpClassInvoker;
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\PhpClassInvoker 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...
30
use BEAR\Resource\PrettyJsonRenderer;
31
use BEAR\Resource\RenderInterface;
32
use BEAR\Resource\Resource;
33
use BEAR\Resource\ResourceInterface;
34
use BEAR\Resource\ReverseLinkerInterface;
35
use BEAR\Resource\ReverseLinkInterface;
36
use BEAR\Resource\SchemeCollectionInterface;
37
use BEAR\Resource\UriFactory;
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\UriFactory 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...
38
use Override;
39
use Ray\Di\AbstractModule;
40
use Ray\Di\Exception\NotFound;
41
use Ray\Di\Scope;
42
use Ray\InputQuery\FileUploadFactory;
43
use Ray\InputQuery\FileUploadFactoryInterface;
44
use Ray\InputQuery\InputQuery;
45
use Ray\InputQuery\InputQueryInterface;
46
47
/**
48
 * Provides ResourceInterface and derived bindings
49
 *
50
 * The following module is installed:
51
 *
52
 * UriFactory
53
 * ResourceInterface
54
 * InvokerInterface
55
 * LinkerInterface
56
 * FactoryInterface
57
 * SchemeCollectionInterface
58
 * AnchorInterface
59
 * NamedParameterInterface
60
 * RenderInterface
61
 * RenderInterface-options
62
 * OptionsMethods
63
 * NamedParamMetasInterface
64
 * ExtraMethodInvoker
65
 * HalLink
66
 * ReverseLinkInterface
67
 * LoggerInterface
68
 * HalLinker
69
 * ReverseLinkerInterface
70
 */
71
final class ResourceClientModule extends AbstractModule
72
{
73
    /**
74
     * {@inheritDoc}
75
     *
76
     * @throws NotFound
77
     */
78
    #[Override]
79
    protected function configure(): void
80
    {
81
        $this->bind(UriFactory::class);
82
        $this->bind(ResourceInterface::class)->to(Resource::class)->in(Scope::SINGLETON);
83
        $this->bind(InvokerInterface::class)->to(Invoker::class);
84
        $this->bind(LinkerInterface::class)->to(Linker::class);
85
        $this->bind(FactoryInterface::class)->to(Factory::class);
86
        $this->bind(SchemeCollectionInterface::class)->toProvider(SchemeCollectionProvider::class);
0 ignored issues
show
Bug introduced by
The type BEAR\Resource\Module\SchemeCollectionProvider 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...
87
        $this->bind(AnchorInterface::class)->to(Anchor::class);
88
        $this->bind(NamedParameterInterface::class)->to(NamedParameter::class);
89
        $this->bind(RenderInterface::class)->to(PrettyJsonRenderer::class)->in(Scope::SINGLETON);
90
        /** @psalm-suppress DeprecatedClass */
91
        $this->bind(RenderInterface::class)->annotatedWith('options')->to(OptionsRenderer::class);
92
        $this->bind(OptionsMethods::class);
93
        $this->bind(NamedParamMetasInterface::class)->to(NamedParamMetas::class);
94
        $this->bind(ExtraMethodInvoker::class);
95
        $this->bind(HalLinker::class);
96
        $this->bind(ReverseLinkerInterface::class)->to(NullReverseLinker::class);
97
        $this->bind(LoggerInterface::class)->to(NullLogger::class);
98
        $this->configureDeprecatedBindings();
99
        $this->bind(PhpClassInvoker::class);
100
        $this->bind(InputQueryInterface::class)->to(InputQuery::class);
101
        $this->bind(FileUploadFactoryInterface::class)->to(FileUploadFactory::class);
102
        $this->bind(DataLoader::class);
103
    }
104
105
    /** @psalm-suppress DeprecatedClass */
106
    private function configureDeprecatedBindings(): void
107
    {
108
        $this->bind(HalLink::class);
109
        $this->bind(ReverseLinkInterface::class)->to(NullReverseLink::class);
110
    }
111
}
112