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

CookieRequestTrait::setCookieVar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
use vsc\Exception;
11
12
trait CookieRequestTrait {
13
	protected $aCookieVars = array();
14
15 17
	protected function initCookie($aCookies) {
16 17
		$this->aCookieVars = $aCookies;
17 17
	}
18
19
	/**
20
	 * @param string $sVarName
21
	 * @return bool
22
	 */
23
	public function hasCookieVar($sVarName) {
24
		return array_key_exists($sVarName, $this->aCookieVars);
25
	}
26
27
	/**
28
	 *
29
	 * @param string $sVarName
30
	 * @throws Exception
31
	 * @return mixed
32
	 */
33 View Code Duplication
	protected function getCookieVar($sVarName) {
0 ignored issues
show
Duplication introduced by
This method 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...
34
		if (array_key_exists($sVarName, $this->aCookieVars)) {
35
			return HttpRequestA::getDecodedVar($this->aCookieVars[$sVarName]);
36
		} else {
37
			return null;
38
		}
39
	}
40
41
	/**
42
	 * @return array
43
	 */
44
	public function getCookieVars() {
45
		return $this->aCookieVars;
46
	}
47
48
	/**
49
	 * @param string $sVarName
50
	 * @param string $sVarValue
51
	 * @return bool
52
	 */
53
	public function setCookieVar($sVarName, $sVarValue) {
54
		return setcookie($sVarName, $sVarValue);
55
	}
56
}
57