Completed
Push — release/1.0.3 ( 736428 )
by Tristan
12:40
created

AppServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 36
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A register() 0 14 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
9
class AppServiceProvider extends ServiceProvider
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AppServiceProvider
Loading history...
10
{
11
    /**
12
     * Bootstrap any application services.
13
     *
14
     * @return void
15
     */
16 4
    public function boot()
17
    {
18
        // A lower default string length for migrations is required for
19
        // versions of MySQL < 5.7.7
20 4
        Schema::defaultStringLength(191);
21
22
        //Force all routes and requests to use HTTPS
23 4
        $this->app['request']->server->set('HTTPS', config('app.force_https'));
24 4
    }
25
26
    /**
27
     * Register any application services.
28
     *
29
     * @return void
30
     */
31
    public function register()
32
    {
33
34
        // if ($this->app->environment() !== 'production') {
35
        //     //Generate migrations from database
36
        //     $this->app->register(\Way\Generators\GeneratorsServiceProvider::class);
37
        //     $this->app->register(\Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class);
38
        //
39
        //     //Generate models from database
40
        //     $this->app->register(\Reliese\Coders\CodersServiceProvider::class);
41
        // }
42
43 4
        $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

43
        $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...
44
            return new WhichPortal();
45 4
        });
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...
46 4
    }
47
}
48