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

IgnoredChecker   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 14 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