You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0bf40df
Browse filesBrowse the repository at this point in the historyBrowse files
TypeTraverser::map($parameter->getType(), staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
34
+
TypeTraverser::map($parameter->getType(), newMemoizingTraverser(staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
34
35
if ($typeinstanceof ConditionalType || $typeinstanceof ConditionalTypeForParameter) {
35
36
$conditionalTypes[] = $type;
36
37
}
37
38
38
39
return$traverse($type);
39
-
});
40
+
}));
40
41
41
42
if ($parameter->getOutType() !== null) {
42
-
TypeTraverser::map($parameter->getOutType(), staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
43
+
TypeTraverser::map($parameter->getOutType(), newMemoizingTraverser(staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
43
44
if ($typeinstanceof ConditionalType || $typeinstanceof ConditionalTypeForParameter) {
44
45
$conditionalTypes[] = $type;
45
46
}
46
47
47
48
return$traverse($type);
48
-
});
49
+
}));
49
50
}
50
51
51
52
if ($parameter->getClosureThisType() !== null) {
52
-
TypeTraverser::map($parameter->getClosureThisType(), staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
53
+
TypeTraverser::map($parameter->getClosureThisType(), newMemoizingTraverser(staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
53
54
if ($typeinstanceof ConditionalType || $typeinstanceof ConditionalTypeForParameter) {
TypeTraverser::map($acceptor->getReturnType(), staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
65
+
TypeTraverser::map($acceptor->getReturnType(), newMemoizingTraverser(staticfunction (Type$type, callable$traverse) use (&$conditionalTypes): Type {
65
66
if ($typeinstanceof ConditionalType || $typeinstanceof ConditionalTypeForParameter) {
66
67
$conditionalTypes[] = $type;
67
68
}
68
69
69
70
return$traverse($type);
70
-
});
71
+
}));
71
72
72
73
$errors = [];
73
74
foreach ($conditionalTypesas$conditionalType) {
@@ -77,14 +78,14 @@ public function check(ExtendedParametersAcceptor $acceptor): array
77
78
continue;
78
79
}
79
80
$templateTypes = [];
80
-
TypeTraverser::map($subjectType, staticfunction (Type$type, callable$traverse) use (&$templateTypes): Type {
81
+
TypeTraverser::map($subjectType, newMemoizingTraverser(staticfunction (Type$type, callable$traverse) use (&$templateTypes): Type {
81
82
if ($typeinstanceof TemplateType) {
82
83
$templateTypes[] = $type;
83
84
return$type;
84
85
}
85
86
86
87
return$traverse($type);
87
-
});
88
+
}));
88
89
89
90
if (count($templateTypes) === 0) {
90
91
$errors[] = RuleErrorBuilder::message(sprintf('Conditional return type uses subject type %s which is not part of PHPDoc @template tags.', $subjectType->describe(VerbosityLevel::typeOnly())))
0 commit comments