From 304e090d3de7db754a972c74a349a521a07b6179 Mon Sep 17 00:00:00 2001 From: Andrew Nagy <564256+tm1000@users.noreply.github.com> Date: Mon, 9 Sep 2024 22:12:36 -0700 Subject: [PATCH] Add hasTrait method Add hasTrait method copying other Aware Traits --- src/PhpGenerator/Traits/TraitsAware.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PhpGenerator/Traits/TraitsAware.php b/src/PhpGenerator/Traits/TraitsAware.php index adf2ad4f..23bdc4e2 100644 --- a/src/PhpGenerator/Traits/TraitsAware.php +++ b/src/PhpGenerator/Traits/TraitsAware.php @@ -67,4 +67,9 @@ public function removeTrait(string $name): static unset($this->traits[$name]); return $this; } + + public function hasTrait(string $name): bool + { + return isset($this->traits[$name]); + } }