Passed
Push — feature/0.7.0 ( 75a66b...cbd99f )
by Ryuichi
43:15
created

CustomControllerAnnotation::getAnnotationInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace WebStream\Annotation\Attributes\Custom;
3
4
use WebStream\Annotation\Base\Annotation;
5
use WebStream\Annotation\Base\IAnnotatable;
6
use WebStream\Annotation\Base\IMethod;
7
use WebStream\Annotation\Base\IRead;
8
use WebStream\Container\Container;
9
10
/**
11
 * @Annotation
12
 * @Target("METHOD")
13
 */
14
class CustomControllerAnnotation extends Annotation implements IMethod, IRead
15
{
16
    private $injectAnnotation;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function onInject(array $injectAnnotation)
22
    {
23
        $this->injectAnnotation = $injectAnnotation;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getAnnotationInfo(): array
30
    {
31
        return $this->injectAnnotation;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function onMethodInject(IAnnotatable $instance, \ReflectionMethod $method, Container $container)
38
    {
39
        echo $this->injectAnnotation['type'];
40
    }
41
}
42