1 | <?php |
||
23 | class StatisticsServiceProvider extends ServiceProvider |
||
24 | { |
||
25 | use ConsoleTools; |
||
26 | |||
27 | /** |
||
28 | * The commands to be registered. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $commands = [ |
||
33 | MigrateCommand::class => 'command.rinvex.statistics.migrate', |
||
34 | PublishCommand::class => 'command.rinvex.statistics.publish', |
||
35 | RollbackCommand::class => 'command.rinvex.statistics.rollback', |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function register() |
||
42 | { |
||
43 | // Merge config |
||
44 | $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.statistics'); |
||
45 | |||
46 | // Bind eloquent models to IoC container |
||
47 | $this->app->singleton('rinvex.statistics.datum', $datumModel = $this->app['config']['rinvex.statistics.models.datum']); |
||
48 | $datumModel === Datum::class || $this->app->alias('rinvex.statistics.datum', Datum::class); |
||
49 | |||
50 | $this->app->singleton('rinvex.statistics.request', $requestModel = $this->app['config']['rinvex.statistics.models.request']); |
||
51 | $requestModel === Request::class || $this->app->alias('rinvex.statistics.request', Request::class); |
||
52 | |||
53 | $this->app->singleton('rinvex.statistics.agent', $agentModel = $this->app['config']['rinvex.statistics.models.agent']); |
||
54 | $agentModel === Agent::class || $this->app->alias('rinvex.statistics.agent', Agent::class); |
||
55 | |||
56 | $this->app->singleton('rinvex.statistics.geoip', $geoipModel = $this->app['config']['rinvex.statistics.models.geoip']); |
||
57 | $geoipModel === Geoip::class || $this->app->alias('rinvex.statistics.geoip', Geoip::class); |
||
58 | |||
59 | $this->app->singleton('rinvex.statistics.route', $routeModel = $this->app['config']['rinvex.statistics.models.route']); |
||
60 | $routeModel === Route::class || $this->app->alias('rinvex.statistics.route', Route::class); |
||
61 | |||
62 | $this->app->singleton('rinvex.statistics.device', $deviceModel = $this->app['config']['rinvex.statistics.models.device']); |
||
63 | $deviceModel === Device::class || $this->app->alias('rinvex.statistics.device', Device::class); |
||
64 | |||
65 | $this->app->singleton('rinvex.statistics.platform', $platformModel = $this->app['config']['rinvex.statistics.models.platform']); |
||
66 | $platformModel === Platform::class || $this->app->alias('rinvex.statistics.platform', Platform::class); |
||
67 | |||
68 | $this->app->singleton('rinvex.statistics.path', $pathModel = $this->app['config']['rinvex.statistics.models.path']); |
||
69 | $pathModel === Path::class || $this->app->alias('rinvex.statistics.path', Path::class); |
||
70 | |||
71 | // Register console commands |
||
72 | $this->registerCommands($this->commands); |
||
|
|||
73 | } |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function boot(Router $router) |
||
88 | } |
||
89 |
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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.