File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ parameters:
10
10
internalTag : true
11
11
newStaticInAbstractClassStaticMethod : true
12
12
checkExtensionsForComparisonOperators : true
13
+ checkGenericIterableClasses : true
13
14
reportTooWideBool : true
14
15
rawMessageInBaseline : true
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ parameters:
34
34
internalTag : false
35
35
newStaticInAbstractClassStaticMethod : false
36
36
checkExtensionsForComparisonOperators : false
37
+ checkGenericIterableClasses : false
37
38
reportTooWideBool : false
38
39
rawMessageInBaseline : false
39
40
fileExtensions :
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ parametersSchema:
37
37
internalTag : bool ()
38
38
newStaticInAbstractClassStaticMethod : bool ()
39
39
checkExtensionsForComparisonOperators : bool ()
40
+ checkGenericIterableClasses : bool ()
40
41
reportTooWideBool : bool ()
41
42
rawMessageInBaseline : bool ()
42
43
])
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ final class MissingTypehintCheck
43
43
Traversable::class,
44
44
Iterator::class,
45
45
IteratorAggregate::class,
46
- // Generator::class,
46
+ Generator::class,
47
47
];
48
48
49
49
/**
@@ -54,6 +54,8 @@ public function __construct(
54
54
private bool $ checkMissingCallableSignature ,
55
55
#[AutowiredParameter(ref: '%featureToggles.skipCheckGenericClasses% ' )]
56
56
private array $ skipCheckGenericClasses ,
57
+ #[AutowiredParameter(ref: '%featureToggles.checkGenericIterableClasses% ' )]
58
+ private bool $ checkGenericIterableClasses ,
57
59
)
58
60
{
59
61
}
@@ -118,7 +120,10 @@ public function getNonGenericObjectTypesWithGenericClass(Type $type): array
118
120
if ($ classReflection === null ) {
119
121
return $ type ;
120
122
}
121
- if (in_array ($ classReflection ->getName (), self ::ITERABLE_GENERIC_CLASS_NAMES , true )) {
123
+ if (
124
+ $ this ->checkGenericIterableClasses !== true &&
125
+ in_array ($ classReflection ->getName (), self ::ITERABLE_GENERIC_CLASS_NAMES , true )
126
+ ) {
122
127
// checked by getIterableTypesWithMissingValueTypehint() already
123
128
return $ type ;
124
129
}
You can’t perform that action at this time.
0 commit comments