diff --git a/src/PhpGenerator/Factory.php b/src/PhpGenerator/Factory.php index 5cd58cc4..9dbe007f 100644 --- a/src/PhpGenerator/Factory.php +++ b/src/PhpGenerator/Factory.php @@ -32,7 +32,7 @@ public function fromClassReflection( ): ClassLike { if ($withBodies && $from->isAnonymous()) { - throw new Nette\NotSupportedException('The $withBodies parameter cannot be used for anonymous functions.'); + throw new Nette\NotSupportedException('The $withBodies parameter cannot be used for anonymous classes.'); } $enumIface = null; diff --git a/tests/PhpGenerator/ClassType.from.bodies.phpt b/tests/PhpGenerator/ClassType.from.bodies.phpt index a98a66f0..ad09a3bc 100644 --- a/tests/PhpGenerator/ClassType.from.bodies.phpt +++ b/tests/PhpGenerator/ClassType.from.bodies.phpt @@ -23,7 +23,7 @@ Assert::exception( } }, withBodies: true), Nette\NotSupportedException::class, - 'The $withBodies parameter cannot be used for anonymous functions.', + 'The $withBodies parameter cannot be used for anonymous classes.', );