File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1248,10 +1248,13 @@ public function getEnumCases(): array
1248
1248
1249
1249
public function isCallable (): TrinaryLogic
1250
1250
{
1251
- $ parametersAcceptors = $ this ->findCallableParametersAcceptors ();
1251
+ $ parametersAcceptors = RecursionGuard:: run ( $ this , fn () => $ this ->findCallableParametersAcceptors () );
1252
1252
if ($ parametersAcceptors === null ) {
1253
1253
return TrinaryLogic::createNo ();
1254
1254
}
1255
+ if ($ parametersAcceptors instanceof ErrorType) {
1256
+ return TrinaryLogic::createNo ();
1257
+ }
1255
1258
1256
1259
if (
1257
1260
count ($ parametersAcceptors ) === 1
Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ class RecursionGuard
9
9
private static array $ context = [];
10
10
11
11
/**
12
- * @param callable(): Type $callback
13
- *
12
+ * @template T
13
+ * @param callable(): T $callback
14
+ * @return T|ErrorType
14
15
*/
15
- public static function run (Type $ type , callable $ callback ): Type
16
+ public static function run (Type $ type , callable $ callback )
16
17
{
17
18
$ key = $ type ->describe (VerbosityLevel::value ());
18
19
if (isset (self ::$ context [$ key ])) {
You can’t perform that action at this time.
0 commit comments