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
/*
* This file is part of the OverblogGraphQLBundle package.
*
* (c) Overblog <http://github.com/overblog/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Overblog\GraphQLBundle\Resolver;
use GraphQL\Type\Definition\ResolveInfo;
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();
if (is_array($source) || $source instanceof \ArrayAccess) {
$index = sprintf('[%s]', $fieldName);
if ($accessor->isReadable($source, $index)) {
$property = $accessor->getValue($source, $index);
}
} elseif (is_object($source)) {
if ($accessor->isReadable($source, $fieldName)) {
$property = $accessor->getValue($source, $fieldName);
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.