Completed
Push — master ( 00cd39...47d74e )
by Tom
05:36
created

ResultsController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 2
c 4
b 0
f 1
lcom 0
cbo 2
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchResultsAction() 0 10 2
1
<?php
2
namespace Kineo\Controller;
3
4
use Silex\Application;
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Kineo\Component\Database;
8
use Kineo\Component\ApiResponse;
9
use Kineo\Model\ResultsModel;
10
11
class ResultsController 
12
{	
0 ignored issues
show
Coding Style introduced by
The opening class brace should be on a newline by itself.
Loading history...
13
	public function fetchResultsAction()
14
	{		
15
		$resultsModel = new ResultsModel(new Database());
16
		
17
		if($resultsModel->getResults()) {
18
			return json_encode($resultsModel->results);
19
		} else {
20
			return json_encode(array());
21
		}
22
	}
23
}