Skip to content

Commit 38d4066

Browse files
committed
Happy Stan
1 parent fe81535 commit 38d4066

File tree

5 files changed

+6
-50
lines changed

5 files changed

+6
-50
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ parameters:
1818
- '~^Parameter #3 \$subject of function preg_replace expects array\|string, string\|null given\.$~'
1919
- '~^Parameter #2 \$str of function explode expects string, string\|null given\.$~'
2020
- '~^Parameter #1 \$str of function ucfirst expects string, string\|null given\.$~'
21-
- '~^Method GraphQL\\Doctrine\\Utils::getTypeName\(\) should return string but returns string\|false\.$~'
2221
- '~^Parameter #2 \$type of method GraphQL\\Doctrine\\Factory\\AbstractFieldsConfigurationFactory::adjustNamespace\(\) expects string, string\|null given\.$~'
2322
- '~^Parameter #1 \$driver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:setDefaultDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver\|null given\.$~'
2423
- '~^Parameter #1 \$argument of class ReflectionClass constructor expects class\-string\<T of object\>\|T of object, string given\.$~'

src/Factory/AbstractFieldsConfigurationFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ final protected function reflectionTypeToType(ReflectionNamedType $reflectionTyp
205205
private function findIdentityField(string $className): void
206206
{
207207
$this->metadata = $this->entityManager->getClassMetadata($className);
208+
/** @var array $meta */
208209
foreach ($this->metadata->fieldMappings as $meta) {
209210
if ($meta['id'] ?? false) {
210211
$this->identityField = $meta['fieldName'];

src/Factory/MetadataReader/MappingDriverChainAdapter.php

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,85 +45,36 @@ private function findReader(ReflectionClass $class): Reader
4545
throw new Exception('graphql-doctrine requires ' . $className . ' entity to be configured with a `' . AnnotationDriver::class . '`.');
4646
}
4747

48-
/**
49-
* Gets the annotations applied to a class.
50-
*
51-
* @param ReflectionClass $class the ReflectionClass of the class from which
52-
* the class annotations should be read
53-
*
54-
* @return array an array of Annotations
55-
*/
5648
public function getClassAnnotations(ReflectionClass $class)
5749
{
5850
return $this->findReader($class)
5951
->getClassAnnotations($class);
6052
}
6153

62-
/**
63-
* Gets a class annotation.
64-
*
65-
* @param ReflectionClass $class the ReflectionClass of the class from which
66-
* the class annotations should be read
67-
* @param string $annotationName the name of the annotation
68-
*
69-
* @return null|object the Annotation or NULL, if the requested annotation does not exist
70-
*/
7154
public function getClassAnnotation(ReflectionClass $class, $annotationName)
7255
{
7356
return $this->findReader($class)
7457
->getClassAnnotation($class, $annotationName);
7558
}
7659

77-
/**
78-
* Gets the annotations applied to a method.
79-
*
80-
* @param ReflectionMethod $method the ReflectionMethod of the method from which
81-
* the annotations should be read
82-
*
83-
* @return array an array of Annotations
84-
*/
8560
public function getMethodAnnotations(ReflectionMethod $method)
8661
{
8762
return $this->findReader($method->getDeclaringClass())
8863
->getMethodAnnotations($method);
8964
}
9065

91-
/**
92-
* Gets a method annotation.
93-
*
94-
* @param ReflectionMethod $method the ReflectionMethod to read the annotations from
95-
* @param string $annotationName the name of the annotation
96-
*
97-
* @return null|object the Annotation or NULL, if the requested annotation does not exist
98-
*/
9966
public function getMethodAnnotation(ReflectionMethod $method, $annotationName)
10067
{
10168
return $this->findReader($method->getDeclaringClass())
10269
->getMethodAnnotation($method, $annotationName);
10370
}
10471

105-
/**
106-
* Gets the annotations applied to a property.
107-
*
108-
* @param ReflectionProperty $property the ReflectionProperty of the property
109-
* from which the annotations should be read
110-
*
111-
* @return array an array of Annotations
112-
*/
11372
public function getPropertyAnnotations(ReflectionProperty $property)
11473
{
11574
return $this->findReader($property->getDeclaringClass())
11675
->getPropertyAnnotations($property);
11776
}
11877

119-
/**
120-
* Gets a property annotation.
121-
*
122-
* @param ReflectionProperty $property the ReflectionProperty to read the annotations from
123-
* @param string $annotationName the name of the annotation
124-
*
125-
* @return null|object the Annotation or NULL, if the requested annotation does not exist
126-
*/
12778
public function getPropertyAnnotation(ReflectionProperty $property, $annotationName)
12879
{
12980
return $this->findReader($property->getDeclaringClass())

src/Factory/Type/FilterGroupConditionTypeFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function create(string $className, string $typeName): Type
5858
$this->readCustomOperatorsFromAnnotation($metadata->reflClass);
5959

6060
// Get all scalar fields
61+
/** @var array $mapping */
6162
foreach ($metadata->fieldMappings as $mapping) {
6263

6364
// Skip exclusion specified by user

src/Utils.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ public static function getOperatorTypeName(string $className, LeafType $type): s
3838
/**
3939
* Return an array of all annotations found in the class hierarchy, including its traits, indexed by the class name
4040
*
41+
* @param class-string<T> $annotationName
42+
*
4143
* @return array annotations indexed by the class name where they were found
44+
*
45+
* @template T
4246
*/
4347
public static function getRecursiveClassAnnotations(Reader $reader, ReflectionClass $class, string $annotationName): array
4448
{

0 commit comments

Comments
 (0)