DetectEnvironment   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 19 2
1
<?php namespace Lanin\Laravel\SetupWizard\Support\Bootstrap;
2
3
use Dotenv;
4
use Illuminate\Contracts\Foundation\Application;
5
use InvalidArgumentException;
6
7
class DetectEnvironment
8
{
9
    /**
10
     * Bootstrap the given application.
11
     *
12
     * @param  \Illuminate\Contracts\Foundation\Application $app
13
     * @return void
14
     */
15 6
    public function bootstrap(Application $app)
16
    {
17
        try
18
        {
19 6
            Dotenv::makeMutable();
20 6
            Dotenv::load($app->environmentPath(), $app->environmentFile());
0 ignored issues
show
Bug introduced by
The method environmentPath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean environment()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
Bug introduced by
The method environmentFile() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean environment()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
21 4
            Dotenv::makeImmutable();
22 6
        } catch (InvalidArgumentException $e)
23
        {
24
            //
25
        }
26
27 6
        $app->detectEnvironment(
0 ignored issues
show
Bug introduced by
The method detectEnvironment() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean environment()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
28 6
            function ()
29
            {
30 6
                return env('APP_ENV', 'production');
31
            }
32 6
        );
33 6
    }
34
}
35