Completed
Branch master (13719e)
by Alex
11:33 queued 02:43
created

ReflectionAnnotatedProperty   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 2 Features 1
Metric Value
wmc 2
c 3
b 2
f 1
lcom 1
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNamespaceName() 0 4 1
A getStartLine() 0 4 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 28 and the first side effect is on line 19.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
/**
4
 * Codeburner Framework.
5
 *
6
 * @author Alex Rohleder <[email protected]>
7
 * @copyright 2016 Alex Rohleder
8
 * @license http://opensource.org/licenses/MIT
9
 */
10
11
namespace Codeburner\Annotator\Reflection;
12
13
/**
14
 * Avoid the autoload by manually including the required files.
15
 * This bust significantly the performance.
16
 */
17
18
if (!trait_exists('Codeburner\Annotator\Reflection\AnnotationTrait', false)) {
19
	include __DIR__ . '/AnnotationTrait.php';
20
}
21
22
/**
23
 * Implements the annotation methods into the reflection.
24
 *
25
 * @author Alex Rohleder <[email protected]>
26
 */
27
28
class ReflectionAnnotatedProperty extends \ReflectionProperty
29
{
30
	use AnnotationTrait;
31
32
	/**
33
	 * @return string
34
	 */
35
36
	public function getNamespaceName()
37
	{
38
		return $this->class->getNamespaceName();
39
	}
40
41
	/**
42
	 * Get the property class start line.
43
	 *
44
	 * @return int
45
	 */
46
47
	public function getStartLine()
48
	{
49
		return $this->class->getStartLine();
50
	}
51
52
}
53