Passed
Push — master ( 5fa21f...f08728 )
by Caen
03:34 queued 15s
created

CreatesApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2
1
<?php
2
3
namespace Hyde\Testing;
4
5
use Hyde\Foundation\HydeKernel;
6
use Hyde\Hyde;
7
use Illuminate\Contracts\Console\Kernel;
8
use Illuminate\Foundation\Application;
9
10
trait CreatesApplication
11
{
12
    /**
13
     * Creates the application.
14
     *
15
     * @return \Illuminate\Foundation\Application
16
     */
17
    public function createApplication(): Application
18
    {
19
        $app = require file_exists(__DIR__.'/../../../app/bootstrap.php') ? __DIR__.'/../../../app/bootstrap.php' : getcwd().'/app/bootstrap.php';
20
21
        HydeKernel::setInstance(new HydeKernel(Hyde::path()));
22
23
        $app->make(Kernel::class)->bootstrap();
24
25
        return $app;
26
    }
27
}
28