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.

JsonView   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
B outputModel() 0 25 6
1
<?php
2
/**
3
 * @package presentation
4
 * @subpackage views
5
 * @author marius orcsik <[email protected]>
6
 * @date 2010.04.09
7
 */
8
namespace vsc\presentation\views;
9
10
use vsc\domain\models\ModelA;
11
12
class JsonView extends ViewA implements JsonViewInterface {
13
	protected $sContentType = 'application/json';
14
	protected $sFolder = 'json';
15
16 1
	public function outputModel($oModel) {
17 1
		$flags = 0; //JSON_FORCE_OBJECT;
18
19 1
		if (phpversion() > '5.3.3') {
20 1
			$flags |= JSON_NUMERIC_CHECK;
21
		}
22 1
		if (phpversion() > '5.4.0') {
23 1
			$flags |= JSON_UNESCAPED_UNICODE;
24 1
			if (\vsc\isDebug()) {
25 1
				$flags |= JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES;
26
			}
27
		}
28 1
		if (ModelA::isValid($oModel)) {
29
			/* @var ModelA $oModel */
30
			$sOutput = json_encode($oModel->toArray(), $flags);
31
		} else {
32 1
			$sOutput = json_encode($oModel, $flags);
33
		}
34
35 1
		if (!json_last_error()) {
36 1
			return $sOutput;
37
		} else {
38
			throw new ExceptionView(json_last_error_msg());
39
		}
40
	}
41
}
42