GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

StarterKitServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
rs 10
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
3
namespace Raystech\StarterKit;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
7
class StarterKitServiceProvider extends BaseServiceProvider
8
{
9
  /**
10
   * Perform post-registration booting of services.
11
   *
12
   * @return void
13
   */
14
  public function boot()
15
  {
16
    // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'raystech');
17
    if(config('starter-kit.route_enable', false)) {
18
      $this->loadRoutesFrom(__DIR__.'/Routes/web.php');
19
    }
20
    $this->loadHelpers();
21
    $this->loadViewsFrom(__DIR__.'/Resources/views', 'rt-starter-kit');
22
23
    // Publishing is only necessary when using the CLI.
24
    if ($this->app->runningInConsole()) {
25
      $this->registerConfig();
26
      $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
27
28
      /*
29
      
30
      if (!class_exists('CreateStarterKitTable')) {
31
        $this->publishes([
32
          __DIR__ . '/../database/migrations/create_starter_kit_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_starter_kit_table.php'),
33
        ], 'migrations');
34
      }
35
36
      
37
      // Publishing the views.
38
      $this->publishes([
39
      __DIR__.'/../resources/views' => base_path('resources/views/vendor/raystech'),
40
      ], 'views');
41
42
      // Publishing assets.
43
      $this->publishes([
44
      __DIR__.'/../resources/assets' => public_path('vendor/raystech'),
45
      ], 'assets');
46
47
      // Publishing the translation files.
48
      $this->publishes([
49
      __DIR__.'/../resources/lang' => resource_path('lang/vendor/raystech'),
50
      ], 'translation');
51
52
      // Registering package commands.
53
      // $this->commands([]);
54
55
      */
56
    }
57
  }
58
59
  /**
60
   * Register config.
61
   *
62
   * @return void
63
   */
64
  protected function registerConfig()
65
  {
66
    // Publishing the configuration file.
67
    // echo "Publishing StarterKit Config ...\n";
68
    $this->publishes([
69
      __DIR__ . '/../config/starter-kit.php' => config_path('starter-kit.php'),
70
    ], 'config');
71
72
    $this->mergeConfigFrom(__DIR__ . '/../config/starter-kit.php', 'StarterKit');
73
  }
74
75
  /**
76
   * Register any package services.
77
   *
78
   * @return void
79
   */
80
  public function register()
81
  {
82
    // Register the service the package provides.
83
    $this->app->singleton('StarterKit', 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

83
    $this->app->singleton('StarterKit', 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...
84
      return new StarterKit;
85
    });
86
87
    $this->app->alias(StarterKit::class, 'starter-kit');
88
89
    $this->app->bind(
90
      'Raystech\StarterKit\Supports\SessionStore',
91
      'Raystech\StarterKit\Supports\LaravelSessionStore'
92
    );
93
94
    // Register Flash Toast
95
    $this->app->singleton('flashtoast', function () {
96
      return $this->app->make('RaysTech\StarterKit\Supports\FlashToast');
97
    });
98
  }
99
100
  /**
101
   * Get the services provided by the provider.
102
   *
103
   * @return array
104
   */
105
  public function provides()
106
  {
107
    return ['StarterKit'];
108
  }
109
110
  public function loadHelpers() {
111
    foreach (glob(__DIR__ . '/Helpers/*.php') as $filename) {
112
      require_once($filename);
113
    }
114
  }
115
}
116