MetaMethod::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0116

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 7
cp 0.8571
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0116
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 https://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 Maslosoft\Addendum\Traits\MetaState;
19
use ReflectionMethod;
20
21
/**
22
 * Container for method metadata generated by method annotations
23
 *
24
 * @author Piotr
25
 */
26
class MetaMethod implements AnnotationEntityInterface
27
{
28
29
	use MetaState;
30
31
	/**
32
	 * Name of method
33
	 * @var string
34
	 */
35
	public $name = '';
36
37
	/**
38
	 * Indicates if method is abstract
39
	 * @var bool
40
	 */
41
	public $isAbstract = false;
42
43
	/**
44
	 * Indicates if method is static
45
	 * @var bool
46
	 */
47
	public $isStatic = false;
48
49
	/**
50
	 * Class constructor, set some basic metadata
51
	 * @param ReflectionMethod $info
52
	 */
53 6
	public function __construct(ReflectionMethod $info = null)
54
	{
55
		// For internal use
56 6
		if (null === $info)
57
		{
58
			return;
59
		}
60 6
		$this->name = $info->name;
61 6
		$this->isAbstract = $info->isAbstract();
62 6
		$this->isStatic = $info->isStatic();
63 6
	}
64
65
	public function __get($name)
66
	{
67
		return null;
68
	}
69
70
}
71