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.

ContentTypeController   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 51
ccs 8
cts 12
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 2

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isValidContentType() 0 1 1
A getAvailableContentTypes() 0 1 1
A getController() 0 1 1
A getContentType() 0 3 1
A getDefaultView() 0 2 1
A getResponse() 0 4 1
A getErrorResponse() 0 2 1
A getView() 0 4 1
1
<?php
2
namespace vsc\application\controllers;
3
4
use vsc\presentation\requests\HttpRequestA;
5
use vsc\presentation\views\ExceptionView;
6
use vsc\presentation\views\ViewA;
7
8
class ContentTypeController extends FrontControllerA {
9
10
	/**
11
	 * The current request content type
12
	 * @var string
13
	 */
14
	private $sContentType;
15
16
	public static function isValidContentType($sContentType) {}
0 ignored issues
show
Unused Code introduced by
The parameter $sContentType is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
18
	public function getAvailableContentTypes() {}
19
20
	public function getController() {}
21
22
	public function getContentType() {
23
		return $this->sContentType;
24
	}
25
26
	/**
27
	 * @returns ViewA
28
	 */
29 1
	public function getDefaultView() {
30 1
	}
31
32
	/**
33
	 * @param HttpRequestA $oRequest
34
	 * @param null $oProcessor
35
	 * @return \vsc\presentation\responses\HttpResponseA
0 ignored issues
show
Documentation introduced by
Should the return type not be \vsc\presentation\responses\HttpResponseA|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
36
	 */
37 1
	public function getResponse(HttpRequestA $oRequest, $oProcessor = null) {
38 1
		$this->sContentType = $oRequest->getContentType();
39
40 1
	}
41
42
	/**
43
	 * @param \Exception $e
44
	 * @param HttpRequestA $oRequest
0 ignored issues
show
Documentation introduced by
Should the type for parameter $oRequest not be HttpRequestA|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
45
	 * @return \vsc\presentation\responses\HttpResponseA
0 ignored issues
show
Documentation introduced by
Should the return type not be \vsc\presentation\responses\HttpResponseA|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
46
	 */
47
	public function getErrorResponse(\Exception $e, $oRequest = null) {
48
	}
49
50
	/**
51
	 * @returns ViewA
52
	 * @throws ExceptionView
53
	 */
54 1
	public function getView() {
55 1
		$sContentType = $this->getContentType();
0 ignored issues
show
Unused Code introduced by
$sContentType is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
56
57 1
	}
58
}
59