We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a1a495 commit 95644fbCopy full SHA for 95644fb
src/Global/base.php
@@ -133,6 +133,19 @@ function trait_uses_recursive(string $trait): array
133
}
134
135
136
+if (!function_exists('does_trait_use')) {
137
+ /**
138
+ * @param string $class
139
+ * @param string $trait
140
+ *
141
+ * @return bool
142
+ */
143
+ function does_trait_use(string $class, string $trait): bool
144
+ {
145
+ return isset(trait_uses_recursive($class)[$trait]);
146
+ }
147
+}
148
+
149
if (!function_exists('class_uses_recursive')) {
150
/**
151
* Returns all traits used by a class, its parent classes and trait of their traits.
0 commit comments