File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ public function fromClassReflection(
3131 bool $ withBodies = false ,
3232 ): ClassLike
3333 {
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 . ' );
3636 }
3737
3838 $ enumIface = null ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ require __DIR__ . '/fixtures/bodies.php';
1212Assert::exception (
1313 fn () => ClassType::from (PDO ::class, withBodies: true ),
1414 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 . ' ,
1616);
1717
1818
@@ -23,7 +23,7 @@ Assert::exception(
2323 }
2424 }, withBodies: true ),
2525 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 . ' ,
2727);
2828
2929
You can’t perform that action at this time.
0 commit comments