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

ResultsController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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
}