for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpDraft\Controllers\Admin;
use \Silex\Application;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use PhpDraft\Domain\Models\PhpDraftResponse;
use PhpDraft\Domain\Entities\Draft;
class DraftStatsController
{
public function GetDrafts(Application $app, 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 GetDrafts(Application $app, /** @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.
$drafts = $app['phpdraft.DraftRepository']->GetAllCompletedDrafts();
return $app->json($drafts);
}
public function Create(Application $app, Request $request) {
$draft_id = $request->get('draft_id');
$draft = $app['phpdraft.DraftRepository']->Load($draft_id);
$stats = $app['phpdraft.DraftStatsRepository']->CalculateDraftStatistics($draft);
return $app->json($stats);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.