AsgardCms /
Page
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php namespace Modules\Page\Providers; |
||
| 2 | |||
| 3 | use Illuminate\Support\Facades\Config; |
||
| 4 | use Illuminate\Support\ServiceProvider; |
||
| 5 | use Modules\Page\Entities\Page; |
||
| 6 | use Modules\Page\Repositories\Cache\CachePageDecorator; |
||
| 7 | use Modules\Page\Repositories\Eloquent\EloquentPageRepository; |
||
| 8 | |||
| 9 | class PageServiceProvider extends ServiceProvider |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Indicates if loading of the provider is deferred. |
||
| 13 | * |
||
| 14 | * @var bool |
||
| 15 | */ |
||
| 16 | protected $defer = false; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Register the service provider. |
||
| 20 | * |
||
| 21 | * @return void |
||
| 22 | */ |
||
| 23 | public function register() |
||
| 24 | { |
||
| 25 | $this->registerBindings(); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function boot() |
||
| 29 | { |
||
| 30 | $this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'asgard.page.config'); |
||
| 31 | $this->publishes([__DIR__ . '/../Config/config.php' => config_path('asgard.page.config' . '.php'), ], 'config'); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get the services provided by the provider. |
||
| 36 | * |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | public function provides() |
||
| 40 | { |
||
| 41 | return array(); |
||
| 42 | } |
||
| 43 | |||
| 44 | private function registerBindings() |
||
| 45 | { |
||
| 46 | $this->app->bind( |
||
| 47 | 'Modules\Page\Repositories\PageRepository', |
||
| 48 | function () { |
||
| 49 | $repository = new EloquentPageRepository(new Page()); |
||
|
0 ignored issues
–
show
|
|||
| 50 | |||
| 51 | if (! Config::get('app.cache')) { |
||
| 52 | return $repository; |
||
| 53 | } |
||
| 54 | |||
| 55 | return new CachePageDecorator($repository); |
||
| 56 | } |
||
| 57 | ); |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: