for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
declare(strict_types=1);
namespace Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction\GraphQL\Relay;
use Overblog\GraphQLBundle\Definition\GlobalVariables;
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction;
use Overblog\GraphQLBundle\Generator\TypeGenerator;
final class IdFetcherCallback extends ExpressionFunction
{
public function __construct(GlobalVariables $globalVariables, $name = 'idFetcherCallback')
parent::__construct(
$name,
function ($idFetcher) {
$code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $context, $info) { ';
$code .= 'return '.$idFetcher.'; }';
return $code;
},
// TODO: finish this callback
function ($arguments, $idFetcher) use ($globalVariables): callable {
$globalVariables
This check looks for imports that have been defined, but are not used in the scope.
$idFetcher
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
function ($arguments, /** @scrutinizer ignore-unused */ $idFetcher) use ($globalVariables): callable {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$arguments
function (/** @scrutinizer ignore-unused */ $arguments, $idFetcher) use ($globalVariables): callable {
// [
// 'context' => $context,
// 'args' => $args,
// 'info' => $info
// ] = $arguments;
//
// return function ($value) use ($idFetcher, $globalVariables, $args, $context, $info) {
// return $idFetcher;
// };
throw new \RuntimeException("The expression function 'idFetcherCallback' is not yet finished and therefore is not allowed to be used.");
}
);
This check looks for imports that have been defined, but are not used in the scope.