| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 1 / 1 | CRAP | 100.00% covered (success) | 100.00% | 2 / 2
AController | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 2 / 2 | 2 | 100.00% covered (success) | 100.00% | 2 / 2
__construct | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 2 / 2
start | 100.00% covered (success) | 100.00% | 1 / 1 | 1 |  |  |

1 | <?php
2 |
3 | namespace Tools;
4 |
5 | /**
6 | * Controller abstract class
7 | **/
8 | abstract class AController
9 | {
10 | /**
11 | * @var array $params
12 | * Contains route parameter
13 | * ex: /product/:id will contains {
14 | * 0 => product
15 | * 1 => [ID]
16 | * ':id' => [ID]
17 | **/
18 | protected $params;
19 |
20 | /**
21 | * @param \Tools\Context $context
22 | * @param array $params
23 | * @throws \Exception\Error404 if parameters does not correspond
24 | * On 404 error, router will try to find another route
25 | * Initialize structure
26 | **/
27 | public function __construct($context, $params)
28 | {
29 | $this->params = $params;
30 | }
31 |
32 | /**
33 | * Fullfill Controller's request
34 | **/
35 | public abstract function start();
36 | }
37 |