Completed
Push — master ( b1ab96...b5f370 )
by Mike
04:56
created

CreatesApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createApplication() 0 8 1
A loadRoutes() 0 4 1
1
<?php namespace GeneaLabs\LaravelCaffeine\Tests;
2
3
use GeneaLabs\LaravelCaffeine\Providers\Service as LaravelCaffeineService;
4
use Illuminate\Contracts\Console\Kernel;
5
6
trait CreatesApplication
7
{
8
    public function createApplication()
9
    {
10
        $this->loadRoutes();
11
        $app = require __DIR__ . '/../vendor/laravel/laravel/bootstrap/app.php';
12
        $app->make(Kernel::class)->bootstrap();
13
        $app->register(LaravelCaffeineService::class);
14
15
        return $app;
16
    }
17
18
    protected function loadRoutes()
19
    {
20
        $routes = file_get_contents(__DIR__ . '/../routes/web.php');
21
        file_put_contents(__DIR__ . '/../vendor/laravel/laravel/routes/web.php', $routes);
22
    }
23
}
24