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 @@ -9,3 +9,4 @@ parameters:
9
9
internalTag : true
10
10
newStaticInAbstractClassStaticMethod : true
11
11
checkExtensionsForComparisonOperators : true
12
+ checkGenericIterableClasses : true
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ parameters:
33
33
internalTag : false
34
34
newStaticInAbstractClassStaticMethod : false
35
35
checkExtensionsForComparisonOperators : false
36
+ checkGenericIterableClasses : false
36
37
fileExtensions :
37
38
- php
38
39
checkAdvancedIsset : false
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ parametersSchema:
36
36
internalTag : bool ()
37
37
newStaticInAbstractClassStaticMethod : bool ()
38
38
checkExtensionsForComparisonOperators : bool ()
39
+ checkGenericIterableClasses : bool ()
39
40
])
40
41
fileExtensions : listOf (string ())
41
42
checkAdvancedIsset : bool ()
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