Completed
Push — master ( b7cb0e...ffcfdb )
by Дмитрий
02:53
created

ScopePointer::isClassMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA;
7
8
use PHPSA\Definition\ClassMethod;
9
use PHPSA\Definition\FunctionDefinition;
10
11
class ScopePointer
12
{
13
    /**
14
     * @var ClassMethod|FunctionDefinition
15
     */
16
    protected $object;
17
18 7
    public function __construct($object)
19
    {
20 7
        $this->object = $object;
21 7
    }
22
23
    /**
24
     * Is class Method?
25
     *
26
     * @return bool
27
     */
28 6
    public function isClassMethod()
29
    {
30 6
        return $this->object instanceof ClassMethod;
31
    }
32
33
    /**
34
     * Is class Method?
35
     *
36
     * @return bool
37
     */
38
    public function isFunction()
39
    {
40
        return $this->object instanceof FunctionDefinition;
41
    }
42
43
    /**
44
     * @return ClassMethod|FunctionDefinition
45
     */
46 7
    public function getObject()
47
    {
48 7
        return $this->object;
49
    }
50
}
51