for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FaithGen\SDK\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Auth;
final class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [];
* Register services.
* @return void
public function register()
//
}
* Bootstrap services.
public function boot()
if (request()->headers->has('x-user-key')) {
$user_id = request()->headers->get('x-user-key');
Auth::guard('web')->loginUsingId($user_id);
if (! config('faithgen-sdk.source')) {
Auth::viaRequest('api-key', function ($request) {
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
Auth::viaRequest('api-key', function (/** @scrutinizer ignore-unused */ $request) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$api_key = request()->headers->get('x-api-key');
$class = config('auth.providers.ministries.model');
return $class::whereHas('apiKey', function ($apiKey) use ($api_key) {
return $apiKey->where('api_key', $api_key);
})->first();
});
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.