GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AnnotationTypeReaderTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetType() 0 9 1
A testGetTypeDataProvider() 0 20 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 14 and the first side effect is on line 12.

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
namespace Papper\Tests\Internal;
4
5
use Papper\Internal\AnnotationTypeReader;
6
use Papper\Tests\Internal\AnnotationFixtures\AnotherNS\AliasedClass as AliasedPathClass;
7
use Papper\Tests\Internal\AnnotationFixtures\AnotherNS\AnotherNsClass;
8
use Papper\Tests\Internal\AnnotationFixtures\SameNS\AliasedClass;
9
use Papper\Tests\Internal\AnnotationFixtures\SameNS\Composite;
10
use Papper\Tests\Internal\AnnotationFixtures\SameNS\SameNsClass;
11
12
include 'AnnotationFixtures/PapperGlobalAnnotationClass.php';
13
14
class AnnotationTypeReaderTest extends \PHPUnit_Framework_TestCase
15
{
16
	/**
17
	 * @dataProvider testGetTypeDataProvider
18
	 * @param \Reflector $reflector
19
	 * @param string $classname
20
	 */
21
	public function testGetType($reflector, $classname)
22
	{
23
		// arrange
24
		$annotationReader = new AnnotationTypeReader();
25
		// act
26
		$type = $annotationReader->getType($reflector);
27
		// assert
28
		$this->assertEquals($classname, $type);
29
	}
30
31
	public function testGetTypeDataProvider()
32
	{
33
		return array(
34
			'method, another ns' => array(
35
				new \ReflectionMethod(Composite::className(), 'getAnotherNsClass'), AnotherNsClass::className()
36
			),
37
			'property, same ns' => array(
38
				new \ReflectionProperty(Composite::className(), 'sameNsClass'), SameNsClass::className()
39
			),
40
			'property, aliased class' => array(
41
				new \ReflectionProperty(Composite::className(), 'aliasedClass'), AliasedClass::className()
42
			),
43
			'property, aliased path class' => array(
44
				new \ReflectionProperty(Composite::className(), 'aliasedPathClass'), AliasedPathClass::className()
45
			),
46
			'property, global class' => array(
47
				new \ReflectionProperty(Composite::className(), 'globalClass'), \PapperGlobalAnnotationClass::className()
48
			),
49
		);
50
	}
51
}
52