EmbedResourceModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Module;
6
7
use BEAR\Resource\Annotation\Embed;
8
use BEAR\Resource\EmbedInterceptor;
9
use BEAR\Resource\EmbedInterceptorInterface;
10
use Override;
11
use Ray\Di\AbstractModule;
12
13
/**
14
 * Provides EmbedInterceptor interceptor bindings
15
 */
16
final class EmbedResourceModule extends AbstractModule
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21
    #[Override]
22
    protected function configure(): void
23
    {
24
        $this->bind(EmbedInterceptorInterface::class)->to(EmbedInterceptor::class);
25
        $this->bindInterceptor(
26
            $this->matcher->any(),
27
            $this->matcher->annotatedWith(Embed::class),
28
            [EmbedInterceptorInterface::class],
29
        );
30
    }
31
}
32