Skip to content

Commit

Permalink
ClassType::class(), interface(), traits() & enum() are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 29, 2023
1 parent 1938bec commit 4b5127a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PhpGenerator/ClassType.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,31 @@ 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);
}


/** @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);
}


/** @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);
}


/** @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);
}

Expand Down

0 comments on commit 4b5127a

Please sign in to comment.