Completed
Push — master ( 7e6b92...936a45 )
by Anton
08:09
created

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