FallbackController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fallback() 0 11 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: polidog
5
 * Date: 2016/07/16.
6
 */
7
8
namespace Polidog\LaravelBundle\Controller;
9
10
use Polidog\LaravelBundle\Environment;
11
use Polidog\LaravelBundle\LaravelKernel;
12
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
13
use Illuminate\Http\Request as IlluminateRequest;
14
15
/**
16
 * @Route(service="polidog_laravel.controller.fallback")
17
 */
18
class FallbackController
19
{
20
    protected $env;
21
22
    protected $laravelKernel;
23
24
    public function __construct(Environment $env, LaravelKernel $laravelKernel)
25
    {
26
        $this->env = $env;
27
        $this->laravelKernel = $laravelKernel;
28
    }
29
30
    public function fallback()
31
    {
32
        // env
33
        $this->env->put();
34
35
        $request = IlluminateRequest::capture();
36
        $response = $this->laravelKernel->handle($request);
37
        $this->laravelKernel->terminate($request, $response);
38
39
        return $response;
40
    }
41
}
42