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.

MappingEngineTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testMapperShouldCreateInstanceOfDestinationClass() 0 11 1
A testMappingFromPropertyToProperties() 0 18 1
1
<?php
2
3
namespace Papper\Tests;
4
5
use Papper\Engine;
6
7
class MappingEngineTest extends TestCaseBase
8
{
9
	public function testMapperShouldCreateInstanceOfDestinationClass()
10
	{
11
		// arrange
12
		$engine = new Engine();
13
		// act
14
		/** @var Destination $destination */
15
		$destination = $engine->map(new Source())->toType(Destination::className());
16
		// assert
17
		$this->assertInstanceOf(Destination::className(), $destination);
18
19
	}
20
21
	public function testMappingFromPropertyToProperties()
22
	{
23
		// arrange
24
		$engine = new Engine();
25
		$source = new Source();
26
		$source->propertyToProperty = 'property to property';
27
		$source->propertyToSetter = 'property to setter';
28
		$source->setGetterToProperty('getter to property');
29
		$source->setGetterToSetter('getter to setter');
30
		// act
31
		/** @var Destination $destination */
32
		$destination = $engine->map($source)->toType(Destination::className());
33
		// assert
34
		$this->assertEquals('property to property', $destination->propertyToProperty);
35
		$this->assertEquals('property to setter', $destination->getPropertyToSetter());
36
		$this->assertEquals('getter to property', $destination->getterToProperty);
37
		$this->assertEquals('getter to setter', $destination->getGetterToSetter());
38
	}
39
}
40
41
class Source extends FixtureBase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
42
{
43
	public $propertyToProperty;
44
	public $propertyToSetter;
45
	private $getterToProperty;
46
	private $getterToSetter;
47
48
	public function getGetterToProperty()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
49
	{
50
		return $this->getterToProperty;
51
	}
52
53
	public function setGetterToProperty($getterToProperty)
54
	{
55
		$this->getterToProperty = $getterToProperty;
56
	}
57
58
	public function getGetterToSetter()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
59
	{
60
		return $this->getterToSetter;
61
	}
62
63
	public function setGetterToSetter($getterToSetter)
64
	{
65
		$this->getterToSetter = $getterToSetter;
66
	}
67
}
68
69
class Destination extends FixtureBase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
70
{
71
	public $propertyToProperty;
72
	private $propertyToSetter;
73
	public $getterToProperty;
74
	private $getterToSetter;
75
76
	public function getGetterToSetter()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
77
	{
78
		return $this->getterToSetter;
79
	}
80
81
	public function setGetterToSetter($getterToSetter)
82
	{
83
		$this->getterToSetter = $getterToSetter;
84
	}
85
86
	public function getPropertyToSetter()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
87
	{
88
		return $this->propertyToSetter;
89
	}
90
91
	public function setPropertyToSetter($propertyToSetter)
92
	{
93
		$this->propertyToSetter = $propertyToSetter;
94
	}
95
}
96