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 ( 7b42e1...c93f43 )
by Marius
10:41 queued 04:09
created

GetRequestTrait   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 23.08%

Importance

Changes 0
Metric Value
dl 42
loc 42
ccs 3
cts 13
cp 0.2308
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A initGet() 3 3 1
A hasGetVars() 3 3 1
A hasGetVar() 3 3 1
A getGetVar() 7 7 2
A getGetVars() 3 3 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * @package presentation
4
 * @subpackage requests
5
 * @author marius orcsik <[email protected]>
6
 * @date 21.02.15
7
 */
8
namespace vsc\presentation\requests;
9
10 View Code Duplication
trait GetRequestTrait {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
	protected $aGetVars = array();
12
13 17
	protected function initGet($aGet) {
14 17
		$this->aGetVars = $aGet;
15 17
	}
16
17
	/**
18
	 * @return bool
19
	 */
20
	public function hasGetVars() {
21
		return (count($this->aGetVars) > 0);
22
	}
23
24
	/**
25
	 * @param string $sVarName
26
	 * @return bool
27
	 */
28
	public function hasGetVar($sVarName) {
29
		return array_key_exists($sVarName, $this->aGetVars);
30
	}
31
32
	/**
33
	 *
34
	 * @param string $sVarName
35
	 * @return mixed
36
	 */
37
	protected function getGetVar($sVarName) {
38
		if (array_key_exists($sVarName, $this->aGetVars)) {
39
			return $this->aGetVars[$sVarName];
40
		} else {
41
			return null;
42
		}
43
	}
44
45
	/**
46
	 * @return array
47
	 */
48
	public function getGetVars() {
49
		return $this->aGetVars;
50
	}
51
}
52