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

PostRequestTrait   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 initPost() 3 3 1
A hasPostVars() 3 3 1
A hasPostVar() 3 3 1
A getPostVar() 7 7 2
A getPostVars() 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
11 View Code Duplication
trait PostRequestTrait {
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...
12
	protected $aPostVars = array();
13
14 17
	protected function initPost($aPost) {
15 17
		$this->aPostVars = $aPost;
16 17
	}
17
18
	/**
19
	 * @return bool
20
	 */
21
	public function hasPostVars() {
22
		return (count($this->aPostVars) > 0);
23
	}
24
25
	/**
26
	 * @param string $sVarName
27
	 * @return bool
28
	 */
29
	public function hasPostVar($sVarName) {
30
		return array_key_exists($sVarName, $this->aPostVars);
31
	}
32
33
	/**
34
	 *
35
	 * @param string $sVarName
36
	 * @return mixed
37
	 */
38
	protected function getPostVar($sVarName) {
39
		if (array_key_exists($sVarName, $this->aPostVars)) {
40
			return $this->aPostVars[$sVarName];
41
		} else {
42
			return null;
43
		}
44
	}
45
46
	/**
47
	 * @return array
48
	 */
49
	public function getPostVars() {
50
		return $this->aPostVars;
51
	}
52
}
53