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\Query;
use Application\Api\Field\FieldInterface;
use Application\Model\Account;
use GraphQL\Type\Definition\Type;
abstract class NextAccountCode implements FieldInterface
{
public static function build(): array
return
[
'name' => 'nextAccountCode',
'type' => Type::nonNull(Type::int()),
'description' => 'Next available account code for creation',
'args' => [],
'resolve' => function ($root, array $args): int {
$root
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
'resolve' => function (/** @scrutinizer ignore-unused */ $root, array $args): int {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$args
'resolve' => function ($root, /** @scrutinizer ignore-unused */ array $args): int {
/** @var AccountRepository $repository */
$repository = _em()->getRepository(Account::class);
return $repository->getNextCodeAvailable();
},
];
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.