From caa2e37a98b74a2519f0636ed006aac2fc54ca93 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 29 Aug 2023 20:41:31 +0200 Subject: [PATCH] ClassType::class(), interface(), traits() & enum() are deprecated --- src/PhpGenerator/ClassType.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PhpGenerator/ClassType.php b/src/PhpGenerator/ClassType.php index 1e5ebd69..65d25339 100644 --- a/src/PhpGenerator/ClassType.php +++ b/src/PhpGenerator/ClassType.php @@ -42,6 +42,7 @@ final class ClassType extends ClassLike /** @deprecated create object using 'new Nette\PhpGenerator\ClassType' */ public static function class(?string $name): self { + trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\ClassType", E_USER_DEPRECATED); return new self($name); } @@ -49,6 +50,7 @@ public static function class(?string $name): self /** @deprecated create object using 'new Nette\PhpGenerator\InterfaceType' */ public static function interface(string $name): InterfaceType { + trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\InterfaceType'", E_USER_DEPRECATED); return new InterfaceType($name); } @@ -56,6 +58,7 @@ public static function interface(string $name): InterfaceType /** @deprecated create object using 'new Nette\PhpGenerator\TraitType' */ public static function trait(string $name): TraitType { + trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\TraitType'", E_USER_DEPRECATED); return new TraitType($name); } @@ -63,6 +66,7 @@ public static function trait(string $name): TraitType /** @deprecated create object using 'new Nette\PhpGenerator\EnumType' */ public static function enum(string $name): EnumType { + trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\EnumType'", E_USER_DEPRECATED); return new EnumType($name); }