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.
Completed
Push — master ( 9c1c8e...10db73 )
by Florian
02:38
created

DocumentAdapter::__isset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Stinger Entity Search package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace StingerSoft\EntitySearchBundle\Model;
13
14
class DocumentAdapter implements Document {
15
16
	/**
17
	 * Stores are fields with their values which should be stored in the index
18
	 *
19
	 * @var array
20
	 */
21
	protected $fields = array();
22
23
	/**
24
	 *
25
	 * @var string
26
	 */
27
	protected $entityClass = null;
28
29
	/**
30
	 *
31
	 * @var mixed
32
	 */
33
	protected $entityId = null;
34
35
	/**
36
	 *
37
	 * @var string
38
	 */
39
	protected $file = null;
40
41
	/**
42
	 *
43
	 * {@inheritDoc}
44
	 *
45
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::addField()
46
	 */
47
	public function addField($fieldname, $value) {
48
		$this->fields[$fieldname] = $value;
49
	}
50
51
	/**
52
	 *
53
	 * {@inheritDoc}
54
	 *
55
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::getFields()
56
	 */
57
	public function getFields() {
58
		return $this->fields;
59
	}
60
61
	/**
62
	 *
63
	 * {@inheritDoc}
64
	 *
65
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::getFieldValue()
66
	 */
67
	public function getFieldValue($field) {
68
		return isset($this->fields[$field]) ? $this->fields[$field] : null;
69
	}
70
71
	/**
72
	 *
73
	 * {@inheritDoc}
74
	 *
75
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::addMultiValueField()
76
	 */
77
	public function addMultiValueField($field, $value) {
78
		if(!array_key_exists($field, $this->fields)) {
79
			$this->fields[$field] = array(
80
				$value 
81
			);
82
		} else if(!in_array($value, $this->fields[$field])) {
83
			$this->fields[$field][] = $value;
84
		}
85
	}
86
87
	/**
88
	 *
89
	 * {@inheritDoc}
90
	 *
91
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::setEntityClass()
92
	 */
93
	public function setEntityClass($clazz) {
94
		$this->entityClass = $clazz;
95
	}
96
97
	/**
98
	 *
99
	 * {@inheritDoc}
100
	 *
101
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::getEntityClass()
102
	 */
103
	public function getEntityClass() {
104
		return $this->entityClass;
105
	}
106
107
	/**
108
	 *
109
	 * {@inheritDoc}
110
	 *
111
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::setEntityId()
112
	 */
113
	public function setEntityId($id) {
114
		$this->entityId = $id;
115
	}
116
117
	/**
118
	 *
119
	 * {@inheritDoc}
120
	 *
121
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::getEntityId()
122
	 */
123
	public function getEntityId() {
124
		return $this->entityId;
125
	}
126
127
	/**
128
	 *
129
	 * {@inheritDoc}
130
	 *
131
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::setFile()
132
	 */
133
	public function setFile($path) {
134
		$this->file = $path;
135
	}
136
137
	/**
138
	 *
139
	 * {@inheritDoc}
140
	 *
141
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::__get()
142
	 */
143
	public function __get($name) {
144
		return $this->getFieldValue($name);
145
	}
146
147
	/**
148
	 *
149
	 * {@inheritDoc}
150
	 *
151
	 * @see \StingerSoft\EntitySearchBundle\Model\Document::__isset()
152
	 */
153
	public function __isset($name) {
154
		return $this->getFieldValue($name) !== null;
155
	}
156
}