Skip to content

Commit e4bd941

Browse files
committed
Fixing coding style and adding workaround to csfix issue in PHPStan
1 parent 297848e commit e4bd941

16 files changed

+27
-7
lines changed

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ parameters:
3030
message: '#Method TheCodingMachine\\GraphQLite\\AnnotationReader::getMethodAnnotations\(\) should return array<int, T of object> but returns array<object>.#'
3131
path: src/AnnotationReader.php
3232
- '#Call to an undefined method GraphQL\\Error\\ClientAware::getMessage()#'
33+
# Needed because of a bug in PHP-CS
34+
- '#PHPDoc tag @param for parameter \$args with type mixed is not subtype of native type array<int, mixed>.#'
3335
#-
3436
# message: '#If condition is always true#'
3537
# path: src/Middlewares/SecurityFieldMiddleware.php

src/Mappers/AbstractTypeMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public function canMapClassToInputType(string $className): bool
290290
* Maps a PHP fully qualified class name to a GraphQL input type.
291291
*
292292
* @param class-string<object> $className
293+
*
293294
* @return ResolvableMutableInputInterface&InputObjectType
294295
*
295296
* @throws CannotMapTypeException

src/Mappers/CompositeTypeMapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function addTypeMapper(TypeMapperInterface $typeMapper): void
3535

3636
/**
3737
* Returns true if this type mapper can map the $className FQCN to a GraphQL type.
38+
*
3839
* @param class-string<object> $className
3940
*/
4041
public function canMapClassToType(string $className): bool
@@ -89,6 +90,7 @@ public function getSupportedClasses(): array
8990

9091
/**
9192
* Returns true if this type mapper can map the $className FQCN to a GraphQL input type.
93+
*
9294
* @param class-string<object> $className
9395
*/
9496
public function canMapClassToInputType(string $className): bool
@@ -106,6 +108,7 @@ public function canMapClassToInputType(string $className): bool
106108
* Maps a PHP fully qualified class name to a GraphQL input type.
107109
*
108110
* @param class-string<object> $className
111+
*
109112
* @return ResolvableMutableInputInterface&InputObjectType
110113
*
111114
* @throws CannotMapTypeExceptionInterface

src/Mappers/GlobTypeMapperCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function registerAnnotations(ReflectionClass $refClass, GlobAnnotationsCa
7171

7272
/**
7373
* @param class-string<object> $className
74+
*
7475
* @return class-string<object>|null
7576
*/
7677
public function getTypeByObjectClass(string $className): ?string

src/Mappers/PorpaginasTypeMapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function getSupportedClasses(): array
171171

172172
/**
173173
* Returns true if this type mapper can map the $className FQCN to a GraphQL input type.
174+
*
174175
* @param class-string<object> $className
175176
*/
176177
public function canMapClassToInputType(string $className): bool
@@ -182,7 +183,9 @@ public function canMapClassToInputType(string $className): bool
182183
* Maps a PHP fully qualified class name to a GraphQL input type.
183184
*
184185
* @param class-string<object> $className
186+
*
185187
* @return ResolvableMutableInputInterface&InputObjectType
188+
*
186189
* @throws CannotMapTypeException
187190
*/
188191
public function mapClassToInputType(string $className): ResolvableMutableInputInterface

src/Mappers/RecursiveTypeMapper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ public function getGeneratedObjectTypeFromInterfaceType(MutableInterfaceType $ty
164164

165165
/**
166166
* Returns the closest parent that can be mapped, or null if nothing can be matched.
167+
*
167168
* @param class-string<object> $className
169+
*
168170
* @return class-string<object>|null
169171
*/
170172
public function findClosestMatchingParent(string $className): ?string
@@ -294,6 +296,7 @@ private function getInterfaceToClassNameMap(): array
294296
* Finds the list of interfaces returned by $className.
295297
*
296298
* @param class-string<object> $className
299+
*
297300
* @return InterfaceType[]
298301
*/
299302
public function findInterfaces(string $className): array
@@ -391,6 +394,7 @@ public function canMapClassToInputType(string $className): bool
391394
* Maps a PHP fully qualified class name to a GraphQL input type.
392395
*
393396
* @param class-string<object> $className
397+
*
394398
* @return InputObjectType&ResolvableMutableInputInterface
395399
*
396400
* @throws CannotMapTypeExceptionInterface

src/Mappers/StaticTypeMapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function canMapClassToType(string $className): bool
7878
* Maps a PHP fully qualified class name to a GraphQL type.
7979
*
8080
* @param class-string<object> $className
81+
*
8182
* @throws CannotMapTypeException
8283
*/
8384
public function mapClassToType(string $className, ?OutputType $subType): MutableInterface
@@ -115,6 +116,7 @@ public function canMapClassToInputType(string $className): bool
115116
* Maps a PHP fully qualified class name to a GraphQL input type.
116117
*
117118
* @param class-string<object> $className
119+
*
118120
* @return ResolvableMutableInputInterface&InputObjectType
119121
*
120122
* @throws CannotMapTypeExceptionInterface

src/Mappers/TypeMapperInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function canMapClassToInputType(string $className): bool;
7373
* Maps a PHP fully qualified class name to a GraphQL input type.
7474
*
7575
* @param class-string<object> $className
76+
*
7677
* @return ResolvableMutableInputInterface&InputObjectType
7778
*/
7879
public function mapClassToInputType(string $className): ResolvableMutableInputInterface;

src/Middlewares/MagicPropertyResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getObject(): object
4242
}
4343

4444
/**
45-
* @param array<int, mixed> $args
45+
* @param mixed $args
4646
*
4747
* @return mixed
4848
*/

src/Middlewares/ResolverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function getObject(): object;
1616
public function toString(): string;
1717

1818
/**
19-
* @param array<int, mixed> $args
19+
* @param mixed $args
2020
*
2121
* @return mixed
2222
*/

0 commit comments

Comments
 (0)