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

Http/class.WebSite.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
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