StaticClassUtil
extends AbstractStaticUtil
in package
Table of Contents
Methods
- hasTrait() : bool
- Check if a class or any of its parents implements a trait.
Methods
hasTrait()
Check if a class or any of its parents implements a trait.
public
static hasTrait(object|class-string $class, class-string $trait) : bool
Parameters
- $class : object|class-string
-
The class to check.
- $trait : class-string
-
The trait to check for.
Return values
bool —True if the class or any of its parents implements the trait, false otherwise.