Completed
Push — release/php7.2 ( 857ab0...6615a6 )
by Grant
16:42 queued 09:33
created

AppServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\Support\Facades\Schema;
7
use App\Services\WhichPortal;
8
use Laravel\Dusk\DuskServiceProvider;
9
10
class AppServiceProvider extends ServiceProvider
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AppServiceProvider
Loading history...
11
{
12
    /**
13
     * Bootstrap any application services.
14
     *
15
     * @return void
16
     */
17 20
    public function boot()
18
    {
19
        // A lower default string length for migrations is required for
20
        // versions of MySQL < 5.7.7
21 20
        Schema::defaultStringLength(191);
22
23
        //Force all routes and requests to use HTTPS
24 20
        $this->app['request']->server->set('HTTPS', config('app.force_https'));
25 20
    }
26
27
    /**
28
     * Register any application services.
29
     *
30
     * @return void
31
     */
32 20
    public function register()
33
    {
34
35
        // if ($this->app->environment() !== 'production') {
36
        //     //Generate migrations from database
37
        //     $this->app->register(\Way\Generators\GeneratorsServiceProvider::class);
38
        //     $this->app->register(\Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class);
39
        //
40
        //     //Generate models from database
41
        //     $this->app->register(\Reliese\Coders\CodersServiceProvider::class);
42
        // }
43
44 20
        if ($this->app->environment() !== 'production') {
45
            //Browser testing
46 20
            $this->app->register(\Laravel\Dusk\DuskServiceProvider::class);
47
        }
48
49
        $this->app->singleton(WhichPortal::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

49
        $this->app->singleton(WhichPortal::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
50 4
            return new WhichPortal();
51 20
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
52 20
    }
53
}
54