Completed
Push — develop ( bf9292...0ca5c0 )
by Abdelrahman
02:31
created

FoundationServiceProvider::boot()   C

Complexity

Conditions 10
Paths 32

Size

Total Lines 62

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 62
rs 6.9624
c 0
b 0
f 0
cc 10
nc 32
nop 1

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Providers;
6
7
use Illuminate\Routing\Router;
8
use Illuminate\Support\Collection;
9
use Illuminate\Support\Facades\Schema;
10
use Illuminate\Support\ServiceProvider;
11
use Rinvex\Support\Traits\ConsoleTools;
12
use Illuminate\Database\Schema\Blueprint;
13
use Cortex\Foundation\Models\ImportRecord;
14
use Cortex\Foundation\Models\AbstractModel;
15
use Illuminate\View\Compilers\BladeCompiler;
16
use Cortex\Foundation\Generators\LangJsGenerator;
17
use Cortex\Foundation\Console\Commands\SeedCommand;
18
use Illuminate\Database\Eloquent\Relations\Relation;
19
use Cortex\Foundation\Console\Commands\InstallCommand;
20
use Cortex\Foundation\Console\Commands\MigrateCommand;
21
use Cortex\Foundation\Console\Commands\PublishCommand;
22
use Cortex\Foundation\Console\Commands\CoreSeedCommand;
23
use Cortex\Foundation\Console\Commands\RollbackCommand;
24
use Illuminate\Support\Facades\Session as SessionFacade;
25
use Cortex\Foundation\Verifiers\EloquentPresenceVerifier;
26
use Cortex\Foundation\Console\Commands\CoreInstallCommand;
27
use Cortex\Foundation\Console\Commands\CoreMigrateCommand;
28
use Cortex\Foundation\Console\Commands\CorePublishCommand;
29
use Cortex\Foundation\Console\Commands\CoreRollbackCommand;
30
use Cortex\Foundation\Http\Middleware\NotificationMiddleware;
31
use Cortex\Foundation\Overrides\Illuminate\Routing\Redirector;
32
use Cortex\Foundation\Overrides\Illuminate\Routing\UrlGenerator;
33
use Cortex\Foundation\Overrides\Mcamara\LaravelLocalization\LaravelLocalization;
34
use Cortex\Foundation\Overrides\Mariuzzo\LaravelJsLocalization\Commands\LangJsCommand;
35
36
class FoundationServiceProvider extends ServiceProvider
37
{
38
    use ConsoleTools;
39
40
    /**
41
     * The commands to be registered.
42
     *
43
     * @var array
44
     */
45
    protected $commands = [
46
        SeedCommand::class => 'command.cortex.foundation.seed',
47
        InstallCommand::class => 'command.cortex.foundation.install',
48
        MigrateCommand::class => 'command.cortex.foundation.migrate',
49
        PublishCommand::class => 'command.cortex.foundation.publish',
50
        RollbackCommand::class => 'command.cortex.foundation.rollback',
51
        CoreSeedCommand::class => 'command.cortex.foundation.coreseed',
52
        CoreInstallCommand::class => 'command.cortex.foundation.coreinstall',
53
        CoreMigrateCommand::class => 'command.cortex.foundation.coremigrate',
54
        CorePublishCommand::class => 'command.cortex.foundation.corempublish',
55
        CoreRollbackCommand::class => 'command.cortex.foundation.corerollback',
56
    ];
57
58
    /**
59
     * Register any application services.
60
     *
61
     * This service provider is a great spot to register your various container
62
     * bindings with the application. As you can see, we are registering our
63
     * "Registrar" implementation here. You can add your own bindings too!
64
     *
65
     * @return void
66
     */
67
    public function register(): void
68
    {
69
        $this->overrideNotificationMiddleware();
70
        $this->overrideLaravelLocalization();
71
        $this->overrideUrlGenerator();
72
        $this->bindPresenceVerifier();
73
        $this->bindBlueprintMacro();
74
        $this->overrideRedirector();
75
        $this->bindBladeCompiler();
76
        $this->overrideLangJS();
77
78
        // Bind eloquent models to IoC container
79
        $this->app->singleton('cortex.foundation.import_record', $importerModel = $this->app['config']['cortex.foundation.models.import_record']);
80
        $importerModel === ImportRecord::class || $this->app->alias('cortex.foundation.import_record', ImportRecord::class);
81
82
        // Merge config
83
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'cortex.foundation');
84
85
        // Override datatables html builder
86
        $this->app->bind(\Yajra\DataTables\Html\Builder::class, \Cortex\Foundation\Overrides\Yajra\DataTables\Html\Builder::class);
87
88
        // Register console commands
89
        ! $this->app->runningInConsole() || $this->registerCommands();
90
    }
91
92
    /**
93
     * Bootstrap any application services.
94
     *
95
     * @return void
96
     */
97
    public function boot(Router $router): void
98
    {
99
        // Fix the specified key was too long error
100
        Schema::defaultStringLength(191);
101
102
        // Override presence verifier
103
        $this->app['validator']->setPresenceVerifier($this->app['cortex.foundation.presence.verifier']);
104
105
        // Early set application locale globaly
106
        $router->pattern('locale', '[a-z]{2}');
107
        $this->app['laravellocalization']->setLocale();
108
109
        $router->model('media', config('medialibrary.media_model'));
110
111
        // Map relations
112
        Relation::morphMap([
113
            'media' => config('medialibrary.media_model'),
114
        ]);
115
116
        // Load resources
117
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/adminarea.php');
118
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/frontarea.php');
119
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/tenantarea.php');
120
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/managerarea.php');
121
        $this->loadViewsFrom(__DIR__.'/../../resources/views', 'cortex/foundation');
122
        $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'cortex/foundation');
123
        $this->app->runningInConsole() || $this->app->afterResolving('blade.compiler', function () {
124
            $accessarea = $this->app['request']->route('accessarea');
125
            ! file_exists($menus = __DIR__."/../../routes/menus/{$accessarea}.php") || require $menus;
126
            ! file_exists($breadcrumbs = __DIR__."/../../routes/breadcrumbs/{$accessarea}.php") || require $breadcrumbs;
127
        });
128
129
        // Publish Resources
130
        ! $this->app->runningInConsole() || $this->publishesLang('cortex/foundation', true);
131
        ! $this->app->runningInConsole() || $this->publishesViews('cortex/foundation', true);
132
        ! $this->app->runningInConsole() || $this->publishesConfig('cortex/foundation', true);
133
        ! $this->app->runningInConsole() || $this->publishesMigrations('cortex/foundation', true);
134
135
        SessionFacade::extend('database', function ($app) {
136
            $table = $app['config']['session.table'];
137
138
            $lifetime = $app['config']['session.lifetime'];
139
            $connection = $app['config']['session.connection'];
140
141
            return new \Cortex\Foundation\Overrides\Illuminate\Session\DatabaseSessionHandler(
142
                $app['db']->connection($connection), $table, $lifetime, $app
143
            );
144
        });
145
146
        $this->app->booted(function () {
147
            if ($this->app->routesAreCached()) {
148
                require $this->app->getCachedRoutesPath();
149
            } else {
150
                $this->app['router']->getRoutes()->refreshNameLookups();
151
                $this->app['router']->getRoutes()->refreshActionLookups();
152
            }
153
        });
154
155
        Collection::macro('similar', function (Collection $newCollection) {
156
            return $newCollection->diff($this)->isEmpty() && $this->diff($newCollection)->isEmpty();
0 ignored issues
show
Bug introduced by
The method diff() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
157
        });
158
    }
159
160
    /**
161
     * Override notification middleware.
162
     *
163
     * @return void
164
     */
165
    protected function overrideNotificationMiddleware(): void
166
    {
167
        $this->app->singleton('Cortex\Foundation\Http\Middleware\NotificationMiddleware', function ($app) {
168
            return new NotificationMiddleware(
169
                $app['session.store'],
170
                $app['notification'],
171
                $app['config']->get('notification.session_key')
172
            );
173
        });
174
    }
175
176
    /**
177
     * Bind blade compiler.
178
     *
179
     * @return void
180
     */
181
    protected function bindBladeCompiler(): void
182
    {
183
        $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {
184
185
            // @alerts('container')
186
            $bladeCompiler->directive('alerts', function ($container = null) {
187
                if (strcasecmp('()', $container) === 0) {
188
                    $container = null;
189
                }
190
191
                return "<?php echo app('notification')->container({$container})->show(); ?>";
192
            });
193
        });
194
    }
195
196
    /**
197
     * Override the Redirector instance.
198
     *
199
     * @return void
200
     */
201
    protected function overrideRedirector(): void
202
    {
203
        $this->app->singleton('redirect', function ($app) {
204
            $redirector = new Redirector($app['url']);
205
206
            // If the session is set on the application instance, we'll inject it into
207
            // the redirector instance. This allows the redirect responses to allow
208
            // for the quite convenient "with" methods that flash to the session.
209
            if (isset($app['session.store'])) {
210
                $redirector->setSession($app['session.store']);
211
            }
212
213
            return $redirector;
214
        });
215
    }
216
217
    /**
218
     * Override the UrlGenerator instance.
219
     *
220
     * @return void
221
     */
222
    protected function overrideUrlGenerator(): void
223
    {
224
        $this->app->singleton('url', function ($app) {
225
            $routes = $app['router']->getRoutes();
226
227
            // The URL generator needs the route collection that exists on the router.
228
            // Keep in mind this is an object, so we're passing by references here
229
            // and all the registered routes will be available to the generator.
230
            $app->instance('routes', $routes);
231
232
            $url = new UrlGenerator(
233
                $routes, $app->rebinding(
234
                    'request', $this->requestRebinder()
235
                )
236
            );
237
238
            $url->setSessionResolver(function () {
239
                return $this->app['session'];
240
            });
241
242
            // If the route collection is "rebound", for example, when the routes stay
243
            // cached for the application, we will need to rebind the routes on the
244
            // URL generator instance so it has the latest version of the routes.
245
            $app->rebinding('routes', function ($app, $routes) {
246
                $app['url']->setRoutes($routes);
247
            });
248
249
            return $url;
250
        });
251
    }
252
253
    /**
254
     * Get the URL generator request rebinder.
255
     *
256
     * @return \Closure
257
     */
258
    protected function requestRebinder()
259
    {
260
        return function ($app, $request) {
261
            $app['url']->setRequest($request);
262
        };
263
    }
264
265
    /**
266
     * Override the LaravelLocalization instance.
267
     *
268
     * @return void
269
     */
270
    protected function overrideLaravelLocalization(): void
271
    {
272
        $this->app->singleton('laravellocalization', function () {
273
            return new LaravelLocalization();
274
        });
275
    }
276
277
    /**
278
     * Register console commands.
279
     *
280
     * @return void
281
     */
282
    protected function overrideLangJS(): void
283
    {
284
        // Bind the Laravel JS Localization command into the app IOC.
285
        $this->app->singleton('localization.js', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

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

Loading history...
286
            $app = $this->app;
287
            $laravelMajorVersion = (int) $app::VERSION;
288
289
            $files = $app['files'];
290
291
            if ($laravelMajorVersion === 4) {
292
                $langs = $app['path.base'].'/app/lang';
293
            } elseif ($laravelMajorVersion === 5) {
294
                $langs = $app['path.base'].'/resources/lang';
295
            }
296
            $messages = $app['config']->get('localization-js.messages');
297
            $generator = new LangJsGenerator($files, $langs, $messages);
0 ignored issues
show
Bug introduced by
The variable $langs does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
298
299
            return new LangJsCommand($generator);
300
        });
301
302
        // Bind the Laravel JS Localization command into Laravel Artisan.
303
        $this->commands('localization.js');
304
    }
305
306
    /**
307
     * Bind presence verifier.
308
     *
309
     * @return void
310
     */
311
    protected function bindPresenceVerifier(): void
312
    {
313
        $this->app->bind('cortex.foundation.presence.verifier', function ($app) {
314
            return new EloquentPresenceVerifier($app['db'], new $app[AbstractModel::class]());
315
        });
316
    }
317
318
    /**
319
     * Bind blueprint macro.
320
     *
321
     * @return void
322
     */
323
    protected function bindBlueprintMacro(): void
324
    {
325
        Blueprint::macro('auditable', function () {
326
            $this->integer('created_by_id')->unsigned()->after('created_at')->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
327
            $this->string('created_by_type')->after('created_at')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
328
            $this->integer('updated_by_id')->unsigned()->after('updated_at')->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
329
            $this->string('updated_by_type')->after('updated_at')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
330
        });
331
332
        Blueprint::macro('dropAuditable', function () {
333
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
334
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
335
            $this->dropForeign($this->createIndexName('foreign', ['created_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
336
            $this->dropForeign($this->createIndexName('foreign', ['created_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
337
            $this->dropColumn(['updated_by_type', 'updated_by_id', 'created_by_type', 'created_by_id']);
0 ignored issues
show
Bug introduced by
The method dropColumn() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
338
        });
339
340
        Blueprint::macro('auditableAndTimestamps', function ($precision = 0) {
341
            $this->timestamp('created_at', $precision)->nullable();
0 ignored issues
show
Bug introduced by
The method timestamp() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
342
            $this->integer('created_by_id')->unsigned()->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
343
            $this->string('created_by_type')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
344
            $this->timestamp('updated_at', $precision)->nullable();
0 ignored issues
show
Bug introduced by
The method timestamp() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
345
            $this->integer('updated_by_id')->unsigned()->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
346
            $this->string('updated_by_type')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
347
        });
348
349
        Blueprint::macro('dropauditableAndTimestamps', function () {
350
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
351
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
352
            $this->dropForeign($this->createIndexName('foreign', ['updated_at']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
353
            $this->dropForeign($this->createIndexName('foreign', ['created_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
354
            $this->dropForeign($this->createIndexName('foreign', ['created_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
355
            $this->dropForeign($this->createIndexName('foreign', ['created_at']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
356
            $this->dropColumn(['updated_by_type', 'updated_by_id', 'updated_at', 'created_by_type', 'created_by_id', 'created_at']);
0 ignored issues
show
Bug introduced by
The method dropColumn() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
357
        });
358
    }
359
}
360