for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TarfinLabs\Netgsm;
use GuzzleHttp\Client;
use Illuminate\Support\ServiceProvider;
use TarfinLabs\Netgsm\Exceptions\InvalidConfiguration;
class NetgsmServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*/
public function boot()
$this->loadTranslationsFrom(dirname(__DIR__).'/resources/lang', 'netgsm');
if ($this->app->runningInConsole()) {
$this->publishes([
dirname(__DIR__).'/resources/lang' => resource_path('lang/vendor/netgsm'),
]);
__DIR__.'/../config/config.php' => config_path('netgsm.php'),
], 'config');
}
* Register the application services.
public function register()
// Automatically apply the package configuration
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'netgsm');
$this->app->singleton(Netgsm::class, 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(Netgsm::class, 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.
$config = config('netgsm');
if (is_null($config)) {
throw InvalidConfiguration::configurationNotSet();
$client = new Client([
'base_uri' => $config['defaults']['base_uri'],
'timeout' => $config['defaults']['timeout'],
return new Netgsm($client, $config['credentials'], $config['defaults']);
});
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.