| 1 | <?php |
||
| 2 | |||
| 3 | namespace ApiChef\RequestQueryHelper; |
||
| 4 | |||
| 5 | use Illuminate\Http\Request; |
||
| 6 | use Illuminate\Support\ServiceProvider; |
||
| 7 | |||
| 8 | class RequestQueryHelperServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | 33 | public function boot() |
|
| 11 | { |
||
| 12 | 33 | $this->publishes([ |
|
| 13 | 33 | __DIR__.'/../config/request-query-helper.php' => config_path('request-query-helper.php'), |
|
| 14 | 33 | ], 'config'); |
|
| 15 | |||
| 16 | Request::macro('filters', function () { |
||
| 17 | 6 | return new QueryParamBag($this->get(config('request-query-helper.filter.name'))); |
|
|
0 ignored issues
–
show
|
|||
| 18 | 33 | }); |
|
| 19 | |||
| 20 | Request::macro('includes', function () { |
||
| 21 | 6 | return new QueryParamBag($this->get(config('request-query-helper.include.name'))); |
|
| 22 | 33 | }); |
|
| 23 | |||
| 24 | Request::macro('fields', function () { |
||
| 25 | 12 | return new Fields($this->get(config('request-query-helper.fields.name'), [])); |
|
| 26 | 33 | }); |
|
| 27 | |||
| 28 | Request::macro('sorts', function () { |
||
| 29 | 6 | return new Sorts($this->get(config('request-query-helper.sort.name'))); |
|
| 30 | 33 | }); |
|
| 31 | |||
| 32 | Request::macro('paginationParams', function () { |
||
| 33 | 6 | return new PaginationParams(config('request-query-helper.pagination'), $this); |
|
| 34 | 33 | }); |
|
| 35 | 33 | } |
|
| 36 | |||
| 37 | 33 | public function register(): void |
|
| 38 | { |
||
| 39 | 33 | $this->mergeConfigFrom( |
|
| 40 | 33 | __DIR__.'/../config/request-query-helper.php', |
|
| 41 | 33 | 'query-params' |
|
| 42 | ); |
||
| 43 | 33 | } |
|
| 44 | } |
||
| 45 |
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.