for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zvermafia\LaraTransliteration;
use GuzzleHttp\Client;
use Zvermafia\Transliteration\Transliterator;
use Zvermafia\Transliteration\Contracts\TransliteratorContract;
use Illuminate\Support\ServiceProvider;
class LaraTransliterationServiceProvider extends ServiceProvider
{
/** @var string */
const SERVICE_NAME = 'zvermafia.laratransliterator';
/**
* Register the application services.
*
* @return void
*/
public function register()
// Prepare the HTTP client
$client = new Client([
'base_uri' => Transliterator::API_BASE_URI,
]);
$this->app->singleton(self::SERVICE_NAME, function ($app) use ($client) {
$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(self::SERVICE_NAME, function (/** @scrutinizer ignore-unused */ $app) use ($client) {
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 Transliterator($client);
});
$this->app->alias(self::SERVICE_NAME, TransliteratorContract::class);
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.