Passed
Branch 3.0.0 (98e096)
by Pieter
02:47
created

FakeAnnotationsPlugin::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace W2w\Lib\Apie\Plugins;
5
6
7
use Doctrine\Common\Annotations\Reader;
8
use W2w\Lib\Apie\ExtendReaderWithConfigReader;
9
use W2w\Lib\Apie\PluginInterfaces\AnnotationReaderProviderInterface;
10
use W2w\Lib\Apie\PluginInterfaces\ApieAwareInterface;
11
use W2w\Lib\Apie\PluginInterfaces\ApieAwareTrait;
12
13
class FakeAnnotationsPlugin implements AnnotationReaderProviderInterface, ApieAwareInterface
14
{
15
    use ApieAwareTrait;
16
17
    private $config;
18
19
    public function __construct(array $config)
20
    {
21
        $this->config = $config;
22
    }
23
24
    public function getAnnotationReader(): Reader
25
    {
26
        $reader = $this->getApie()->getPlugin(CorePlugin::class)->getAnnotationReader();
27
        return new ExtendReaderWithConfigReader($reader, $this->config);
28
    }
29
}
30