scriptotek /
bibrex
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Providers; |
||
| 4 | |||
| 5 | use App\Alma\AlmaUsers; |
||
| 6 | use Illuminate\Contracts\Foundation\Application; |
||
| 7 | use Illuminate\Support\ServiceProvider; |
||
| 8 | use Scriptotek\Alma\Client as AlmaClient; |
||
| 9 | |||
| 10 | class AlmaServiceProvider extends ServiceProvider |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Indicates if loading of the provider is deferred. |
||
| 14 | * |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | protected $defer = true; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Register services. |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | public function register() |
||
| 25 | { |
||
| 26 | $this->app->singleton(AlmaClient::class, function (Application $app) { |
||
|
0 ignored issues
–
show
|
|||
| 27 | return new AlmaClient(config('services.alma.key'), 'eu'); |
||
| 28 | }); |
||
| 29 | $this->app->singleton(AlmaUsers::class, function (Application $app) { |
||
| 30 | return new AlmaUsers($app->make(AlmaClient::class)); |
||
| 31 | }); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get the services provided by the provider. |
||
| 36 | * |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | public function provides() |
||
| 40 | { |
||
| 41 | return [ |
||
| 42 | AlmaClient::class, |
||
| 43 | AlmaUsers::class, |
||
| 44 | ]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.