fomvasss /
laravel-slugmaker
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Fomvasss\SlugMaker; |
||
| 4 | |||
| 5 | use Fomvasss\SlugMaker\Models\Slug; |
||
| 6 | use Illuminate\Support\ServiceProvider; |
||
| 7 | |||
| 8 | class SlugMakerServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | public function boot() |
||
| 11 | { |
||
| 12 | $this->publishes([ |
||
| 13 | __DIR__.'/../config/slugmaker.php' => $this->app->configPath().'/slugmaker.php', |
||
| 14 | ], 'slugmaker-config'); |
||
| 15 | |||
| 16 | if (! class_exists('CreateSlugsTable')) { |
||
| 17 | $timestamp = date('Y_m_d_His', time()); |
||
| 18 | |||
| 19 | $this->publishes([ |
||
| 20 | __DIR__.'/../database/migrations/create_slugs_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_slugs_table.php", |
||
| 21 | ], 'slugmaker-migrations'); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | public function register() |
||
| 26 | { |
||
| 27 | $this->mergeConfigFrom(__DIR__.'/../config/slugmaker.php', 'slugmaker'); |
||
| 28 | |||
| 29 | $this->app->bind(SlugHelper::class, function () { |
||
| 30 | return new SlugHelper(new Slug()); |
||
|
0 ignored issues
–
show
|
|||
| 31 | }); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.