Completed
Push — master ( ab26f3...439ddb )
by Peter
09:17
created

IgnoredChecker::check()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 14
ccs 0
cts 13
cp 0
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
crap 12
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\Utilities;
16
17
use Maslosoft\Addendum\Interfaces\AnnotatedReflectorInterface;
18
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedMethod;
19
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedProperty;
20
21
/**
22
 * IgnoredChecker
23
 *
24
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
25
 */
26
class IgnoredChecker
27
{
28
29
	/**
30
	 * Check if entity is ignored
31
	 * @param ReflectionAnnotatedMethod|ReflectionAnnotatedProperty|AnnotatedReflectorInterface $target
32
	 * @return bool
33
	 */
34
	public static function check(AnnotatedReflectorInterface $target)
35
	{
36
		if (!$target->hasAnnotation('Ignored'))
37
		{
38
			return false;
39
		}
40
41
		$value = $target->getAnnotation('Ignored')->value;
42
		if (false === $value)
43
		{
44
			return false;
45
		}
46
		return true;
47
	}
48
49
}
50