for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Health\Controllers;
use Illuminate\Routing\Controller;
use Health\Services\HealthService;
use Symfony\Component\HttpFoundation\Request;
use Health\Resources\Health;
use Illuminate\Http\Response;
/**
* Health Check Controler
*/
class HealthController extends Controller
{
*
* @var HealthService
private $healthService;
* @param HealthService $healthService
public function __construct(HealthService $healthService)
$this->healthService = $healthService;
}
* @param Request $request
* @return \Illuminate\Http\JsonResponse
public function check(Request $request)
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function check(/** @scrutinizer ignore-unused */ Request $request)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$health = $this->healthService->getHealth(config('health.checks', []));
$statusCode = $health->isOk() ? Response::HTTP_OK : Response::HTTP_SERVICE_UNAVAILABLE;
$response = new Health($health);
$response->withoutWrapping();
return $response->response()->setStatusCode($statusCode);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.