AnnotatedMethod::getAnnotation()   A
last analyzed

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 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Annotations;
13
14
/**
15
 * @deprecated since v2.12. Will be removed in v3.0
16
 */
17
final class AnnotatedMethod
18
{
19
    /** @var \ReflectionMethod */
20
    private $method;
21
22
    /** @var mixed */
23
    private $annotation;
24
25
    /**
26
     * @param mixed             $annotation
27
     */
28
    public function __construct(\ReflectionMethod $method, $annotation)
29
    {
30
        $this->method = $method;
31
        $this->annotation = $annotation;
32
    }
33
34
    public function getClass(): \ReflectionClass
35
    {
36
        return $this->method->getDeclaringClass();
37
    }
38
39
    public function getMethod(): \ReflectionMethod
40
    {
41
        return $this->method;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getAnnotation()
48
    {
49
        return $this->annotation;
50
    }
51
}
52