Completed
Push — master ( 439ddb...32f763 )
by Peter
05:03
created

IgnoredChecker::check()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
crap 3
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 14
	public static function check(AnnotatedReflectorInterface $target)
35
	{
36 14
		if (!$target->hasAnnotation('Ignored'))
37
		{
38 14
			return false;
39
		}
40
41 1
		$value = $target->getAnnotation('Ignored')->value;
42 1
		if (false === $value)
43
		{
44 1
			return false;
45
		}
46 1
		return true;
47
	}
48
49
}
50