IgnoredChecker::check()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

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