Passed
Branch develop (b36b95)
by Nuno
02:06
created

LoadConfiguration::getConfigurationFiles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 12
cts 12
cp 1
rs 9.6333
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 function ksort;
17
use function basename;
18
use Symfony\Component\Finder\Finder;
19
use LaravelZero\Framework\Application;
20
use Illuminate\Console\Application as Artisan;
21
use LaravelZero\Framework\Contracts\BoostrapperContract;
22
use LaravelZero\Framework\Bootstrap\BaseLoadConfiguration;
23
24
final class LoadConfiguration implements BoostrapperContract
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29 29
    public function bootstrap(Application $app): void
30
    {
31 29
        $app->make(BaseLoadConfiguration::class)
32 29
            ->bootstrap($app);
33
34 29
        $app->detectEnvironment(
35
            function () use ($app) {
36 29
                return $app['config']->get('app.production', true) ? 'production' : 'development';
37 29
            }
38
        );
39
40
        /*
41
         * When artisan starts, sets the application name and the application version.
42
         */
43 29
        Artisan::starting(
44
            function ($artisan) use ($app) {
45 29
                $artisan->setName($app['config']->get('app.name', 'Laravel Zero'));
46 29
                $artisan->setVersion($app->version());
47 29
            }
48
        );
49 29
    }
50
}
51