for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Part of the AmazonGiftCode package.
* Author: Kashyap Merai <[email protected]>
*
*/
namespace kamerk22\AmazonGiftCode;
use Illuminate\Support\ServiceProvider;
class AmazonGiftCodeServiceProvider extends ServiceProvider
{
* Perform post-registration booting of services.
* @return void
public function boot()
// Publishing is only necessary when using the CLI.
if ($this->app->runningInConsole()) {
$this->bootForConsole();
}
* Register any package services.
public function register()
$this->mergeConfigFrom(__DIR__.'/../config/amazongiftcode.php', 'amazongiftcode');
// Register the service the package provides.
$this->app->singleton('amazongiftcode', function ($app) {
$app
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$this->app->singleton('amazongiftcode', function (/** @scrutinizer ignore-unused */ $app) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return new AmazonGiftCode;
});
* Get the services provided by the provider.
* @return array
public function provides()
return ['amazongiftcode'];
* Console-specific booting.
protected function bootForConsole()
// Publishing the configuration file.
$this->publishes([
__DIR__.'/../config/amazongiftcode.php' => config_path('amazongiftcode.php'),
], 'amazongiftcode.config');
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.