Test Failed
Push — stable ( 994ca0...7d5c83 )
by Nuno
04:30
created

LoadConfiguration::getConfigurationFiles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 12
cts 12
cp 1
rs 9.6
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Laravel Zero.
7
 *
8
 * (c) Nuno Maduro <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace LaravelZero\Framework\Bootstrap;
15
16
use LaravelZero\Framework\Application;
17
use Illuminate\Console\Application as Artisan;
18
use LaravelZero\Framework\Contracts\BoostrapperContract;
19
20
/**
21
 * @internal
22
 */
23
final class LoadConfiguration implements BoostrapperContract
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 29
    public function bootstrap(Application $app): void
29
    {
30 29
        $app->make(BaseLoadConfiguration::class)
31 29
            ->bootstrap($app);
32
33 29
        $app->detectEnvironment(
34
            function () use ($app) {
35 29
                return $app['config']->get('app.production', true) ? 'production' : 'development';
36 29
            }
37
        );
38
39
        /*
40
         * When artisan starts, sets the application name and the application version.
41
         */
42 29
        Artisan::starting(
43
            function ($artisan) use ($app) {
44 29
                $artisan->setName($app['config']->get('app.name', 'Laravel Zero'));
45 29
                $artisan->setVersion($app->version());
46 29
            }
47
        );
48 29
    }
49
}
50