Skip to content

Commit 7957bef

Browse files
committed
Fixing PHPStan
1 parent 4a10c31 commit 7957bef

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

DependencyInjection/GraphqlControllersCompilerPass.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use TheCodingMachine\GraphQL\Controllers\Mappers\StaticTypeMapper;
3434
use TheCodingMachine\GraphQL\Controllers\NamingStrategy;
3535
use TheCodingMachine\GraphQL\Controllers\TypeGenerator;
36+
use TheCodingMachine\GraphQL\Controllers\Types\MutableObjectType;
3637
use TheCodingMachine\GraphQL\Controllers\Types\ResolvableInputObjectType;
3738

3839
/**
@@ -250,20 +251,20 @@ public static function createQueryProvider($controller, FieldsBuilderFactory $fi
250251
}
251252

252253
/**
253-
* @param object $typeClass
254+
* @param string $typeClass
254255
*/
255-
public static function createObjectType($typeClass, TypeGenerator $typeGenerator, RecursiveTypeMapperInterface $recursiveTypeMapper): ObjectType
256+
/*public static function createObjectType(string $typeClass, TypeGenerator $typeGenerator, RecursiveTypeMapperInterface $recursiveTypeMapper): MutableObjectType
256257
{
257258
return $typeGenerator->mapAnnotatedObject($typeClass, $recursiveTypeMapper);
258-
}
259+
}*/
259260

260261
/**
261262
* @param object $factory
262263
*/
263-
public static function createInputObjectType($factory, string $methodName, InputTypeGenerator $inputTypeGenerator, RecursiveTypeMapperInterface $recursiveTypeMapper): InputObjectType
264+
/*public static function createInputObjectType($factory, string $methodName, InputTypeGenerator $inputTypeGenerator, RecursiveTypeMapperInterface $recursiveTypeMapper): InputObjectType
264265
{
265266
return $inputTypeGenerator->mapFactoryMethod($factory, $methodName, $recursiveTypeMapper);
266-
}
267+
}*/
267268

268269
/**
269270
* Returns a cached Doctrine annotation reader.

Mappers/ContainerFetcherTypeMapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace TheCodingMachine\Graphql\Controllers\Bundle\Mappers;
55

66
use GraphQL\Type\Definition\InputObjectType;
7+
use GraphQL\Type\Definition\NamedType;
78
use GraphQL\Type\Definition\ObjectType;
89
use GraphQL\Type\Definition\Type;
910
use GraphQL\Type\Definition\InputType;
@@ -80,7 +81,7 @@ public function canMapClassToType(string $className): bool
8081
public function mapClassToType(string $className, ?OutputType $subType, RecursiveTypeMapperInterface $recursiveTypeMapper): MutableObjectType
8182
{
8283
$key = $className;
83-
if ($subType !== null) {
84+
if ($subType instanceof NamedType && $subType !== null) {
8485
$key .= '____'.$subType->name;
8586
}
8687
if (isset($this->types[$key])) {

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ parameters:
22
ignoreErrors:
33
- "#Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition::children\\(\\)#"
44
- "/Parameter #2 $haystack of function in_array expects array, array<string>|string given./"
5+
- "#Access to an undefined property GraphQL\\\\Type\\\\Definition\\\\NamedType&GraphQL\\\\Type\\\\Definition\\\\OutputType::\\$name.#"
56
#includes:
67
# - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

0 commit comments

Comments
 (0)