Completed
Push — master ( ab2960...44d5ac )
by Patrick
03:26
created

WebSite::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Http;
3
4
use \Psr\Http\Message\ServerRequestInterface as Request;
5
use \Psr\Http\Message\ResponseInterface as Response;
6
7
require 'vendor/autoload.php';
8
9
class WebSite extends \Slim\App
10
{
11
    public function __construct()
12
    {
13
        parent::__construct();
14
        $c = $this->getContainer();
15
        $c['errorHandler'] = function($c) { return new WebErrorHandler();};
0 ignored issues
show
Unused Code introduced by
The parameter $c 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...
16
        $this->add(new AuthMiddleware());
17
        $this->add(new ODataMiddleware());
18
    }
19
20
    public function registerPage($uri, $page)
21
    {
22
        $this->get($uri, array($page, 'handleRequest'));
23
    }
24
25
    public function registerAPI($uri, $api)
26
    {
27
        $this->group($uri, function() use($api) {$api->setup($this);})->add(new \Http\Rest\SerializationMiddleware());
28
    }
29
}
30