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\Output\AllPermissionsType;
use Ecodev\Felix\Api\Field\FieldInterface;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Type\Definition\Type;
abstract class Permissions implements FieldInterface
{
public static function build(): iterable
yield 'permissions' => fn () => [
'type' => Type::nonNull(_types()->get(AllPermissionsType::class)),
'description' => 'All permissions for currently logged in user',
'args' => [
],
'resolve' => function ($root, array $args, $context, ResolveInfo $info) {
$info
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, array $args, $context, /** @scrutinizer ignore-unused */ ResolveInfo $info) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$context
'resolve' => function ($root, array $args, /** @scrutinizer ignore-unused */ $context, ResolveInfo $info) {
$contexts = $args;
// Return keys with some dummy data to keep the resolving process going deeper in types
return [
'crud' => ['contexts' => $contexts],
];
},
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.