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
namespace Overblog\GraphQLBundle\Resolver;
use GraphQL\Type\Definition\ResolveInfo;
use Symfony\Component\PropertyAccess\Exception\AccessException;
use Symfony\Component\PropertyAccess\PropertyAccess;
class Resolver
{
public static function defaultResolveFn($source, $args, ResolveInfo $info)
$args
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$fieldName = $info->fieldName;
$property = null;
$accessor = PropertyAccess::createPropertyAccessor();
try {
if (is_array($source) || $source instanceof \ArrayAccess) {
$property = $accessor->getValue($source, sprintf('[%s]', $fieldName));
} else if (is_object($source)) {
$property = $accessor->getValue($source, sprintf('%s', $fieldName));
}
} catch(AccessException $e) {
return $property instanceof \Closure ? $property($source) : $property;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.