Web   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 3
b 0
f 0
dl 0
loc 25
ccs 11
cts 11
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 20 3
1
<?php
2
namespace Fyuze\Kernel\Application;
3
4
use Fyuze\Http\Kernel;
5
use Fyuze\Http\Response;
6
use Fyuze\Http\Request;
7
use Fyuze\Kernel\Fyuze;
8
use Fyuze\Routing\Router;
9
10
class Web extends Fyuze
11
{
12
    /**
13
     * @return Response
14
     */
15 5
    public function boot()
16
    {
17
        // Get system is booting, load routes
18 5
        $routes = $this->loadRoutes();
19
20 5
        $kernel = new Kernel($this->getContainer(), new Router($routes));
21
22 5
        $this->container->add('request', function () {
23 5
            return Request::create();
24 5
        });
25
26 5
        $response = $kernel->handle($this->container->make('request'));
27
28 5
        foreach ($this->services as $service) {
29 5
            if (method_exists($service, 'bootstrap')) {
30 5
                $service->bootstrap();
31
            }
32
        }
33
34 5
        return $response;
35
    }
36
}
37