for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Application\Api\Field\Mutation;
use Application\Enum\Site;
use Application\Model\Statistic;
use Application\Repository\StatisticRepository;
use Ecodev\Felix\Api\Field\FieldInterface;
use GraphQL\Type\Definition\Type;
class RecordSearch implements FieldInterface
{
public static function build(): iterable
yield 'recordSearch' => fn () => [
'type' => Type::nonNull(Type::boolean()),
'description' => 'Record one search in statistics',
'resolve' => function ($root, array $args): bool {
$args
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
'resolve' => function ($root, /** @scrutinizer ignore-unused */ array $args): bool {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
/** @var Site $site */
$site = $root['site'];
/** @var StatisticRepository $statisticRepository */
$statisticRepository = _em()->getRepository(Statistic::class);
$statistic = $statisticRepository->getOrCreate($site);
$statistic->recordSearch();
_em()->flush();
return true;
},
];
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.