BetterReflection\Reflection\ReflectionClass::implementsInterface PHP Method

implementsInterface() public method

Checks whether this class implements the given interface.
public implementsInterface ( string $interfaceName ) : boolean
$interfaceName string
return boolean
    public function implementsInterface($interfaceName)
    {
        if (!is_string($interfaceName)) {
            throw NotAString::fromNonString($interfaceName);
        }
        return in_array(ltrim($interfaceName, '\\'), $this->getInterfaceNames(), true);
    }

Usage Example

 public function implementsInterface(string $className) : bool
 {
     return $this->reflectionClass->implementsInterface($className);
 }
All Usage Examples Of BetterReflection\Reflection\ReflectionClass::implementsInterface