Completed
Push — master ( 7d4d47...4dc2a1 )
by Peter
08:01
created

MetaMethod::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
ccs 7
cts 8
cp 0.875
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
crap 2.0078
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL, Commercial license.
5
 *
6
 * @package maslosoft/addendum
7
 * @licence AGPL, Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]> (Meta container, further improvements, bugfixes)
9
 * @copyright Copyright (c) Maslosoft (Meta container, further improvements, bugfixes)
10
 * @copyright Copyright (c) Jan Suchal (Original version, builder, parser)
11
 * @link http://maslosoft.com/addendum/ - maslosoft addendum
12
 * @link https://code.google.com/p/addendum/ - original addendum project
13
 */
14
15
namespace Maslosoft\Addendum\Collections;
16
17
use Maslosoft\Addendum\Interfaces\AnnotationEntityInterface;
18
use ReflectionMethod;
19
20
/**
21
 * Container for method metadata generated by method annotations
22
 *
23
 * @author Piotr
24
 */
25
class MetaMethod implements AnnotationEntityInterface
26
{
27
28
	use \Maslosoft\Addendum\Traits\MetaState;
29
30
	/**
31
	 * Name of method
32
	 * @var string
33
	 */
34
	public $name = '';
35
36
	/**
37
	 * Indicates if method is abstract
38
	 * @var bool
39
	 */
40
	public $isAbstract = false;
41
42
	/**
43
	 * Indicates if method is static
44
	 * @var bool
45
	 */
46
	public $isStatic = false;
47
48
	/**
49
	 * Class constructor, set some basic metadata
50
	 * @param ReflectionMethod $info
51
	 */
52 5
	public function __construct(ReflectionMethod $info = null)
53
	{
54
		// For internal use
55 5
		if (null === $info)
56 5
		{
57
			return;
58
		}
59 5
		$this->name = $info->name;
60 5
		$this->isAbstract = $info->isAbstract();
61 5
		$this->isStatic = $info->isStatic();
62 5
	}
63
64
	public function __get($name)
65
	{
66
		return null;
67
	}
68
69
}
70