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.

PropertyMap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Papper;
4
5
use Papper\Internal\MemberGetterInterface;
6
use Papper\Internal\MemberSetterInterface;
7
8
class PropertyMap
9
{
10
	/**
11
	 * @var MemberGetterInterface
12
	 */
13
	private $sourceGetter;
14
	/**
15
	 * @var MemberSetterInterface
16
	 */
17
	private $destinationSetter;
18
	/**
19
	 * @var ValueConverterInterface
20
	 */
21
	private $valueConverter = null;
22
	/**
23
	 * @var bool
24
	 */
25
	private $isIgnored = false;
26
	/**
27
	 * @var mixed
28
	 */
29
	private $nullSubtitute = null;
30
31
	public function __construct(MemberSetterInterface $setter, MemberGetterInterface $getter = null)
32
	{
33
		$this->destinationSetter = $setter;
34
		$this->sourceGetter = $getter;
35
	}
36
37
	public function getMemberName()
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...
38
	{
39
		return $this->destinationSetter->getName();
40
	}
41
42
	public function getDestinationSetter()
43
	{
44
		return $this->destinationSetter;
45
	}
46
47
	public function getSourceGetter()
48
	{
49
		return $this->sourceGetter;
50
	}
51
52
	public function setSourceGetter(MemberGetterInterface $sourceGetter)
53
	{
54
		$this->sourceGetter = $sourceGetter;
55
	}
56
57
	public function getValueConverter()
58
	{
59
		return $this->valueConverter;
60
	}
61
62
	public function setValueConverter(ValueConverterInterface $valueConverter)
63
	{
64
		$this->valueConverter = $valueConverter;
65
	}
66
67
	public function hasValueConverter()
68
	{
69
		return $this->valueConverter !== null;
70
	}
71
72
	public function getNullSubtitute()
73
	{
74
		return $this->nullSubtitute;
75
	}
76
77
	public function setNullSubtitute($nullSubtitute)
78
	{
79
		$this->nullSubtitute = $nullSubtitute;
80
	}
81
82
	public function ignore()
83
	{
84
		$this->isIgnored = true;
85
	}
86
87
	public function isIgnored()
88
	{
89
		return $this->isIgnored;
90
	}
91
92
	public function isMapped()
93
	{
94
		return $this->isIgnored || $this->sourceGetter !== null;
95
	}
96
}
97