File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ public function fromClassReflection(
31
31
bool $ withBodies = false ,
32
32
): ClassLike
33
33
{
34
- if ($ withBodies && ($ from ->isAnonymous () || $ from ->isInternal ())) {
35
- throw new Nette \NotSupportedException ('The $withBodies parameter cannot be used for anonymous or internal classes. ' );
34
+ if ($ withBodies && ($ from ->isAnonymous () || $ from ->isInternal () || $ from -> isInterface () )) {
35
+ throw new Nette \NotSupportedException ('The $withBodies parameter cannot be used for anonymous or internal classes or interfaces . ' );
36
36
}
37
37
38
38
$ enumIface = null ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ require __DIR__ . '/fixtures/bodies.php';
12
12
Assert::exception (
13
13
fn () => ClassType::from (PDO ::class, withBodies: true ),
14
14
Nette \NotSupportedException::class,
15
- 'The $withBodies parameter cannot be used for anonymous or internal classes. ' ,
15
+ 'The $withBodies parameter cannot be used for anonymous or internal classes or interfaces . ' ,
16
16
);
17
17
18
18
@@ -23,7 +23,7 @@ Assert::exception(
23
23
}
24
24
}, withBodies: true ),
25
25
Nette \NotSupportedException::class,
26
- 'The $withBodies parameter cannot be used for anonymous or internal classes. ' ,
26
+ 'The $withBodies parameter cannot be used for anonymous or internal classes or interfaces . ' ,
27
27
);
28
28
29
29
You can’t perform that action at this time.
0 commit comments