public static function implementsInterface($value, string $interface): bool
    {
        if (!is_object($value)) {
            if (!(static::classExists($value) || static::interfaceExists($value))) {
                return false;
            }
            $value = (string) $value;
        }

        $reflection = new ReflectionClass($value);

        return $reflection->implementsInterface($interface);
    }
public static function implementsInterface($value, string $interface): bool
    {
        if (!is_object($value)) {
            if (!(static::classExists($value) || static::interfaceExists($value))) {
                return false;
            }
            $value = (string) $value;
        }

        $reflection = new ReflectionClass($value);

        return $reflection->implementsInterface($interface);
    }
public static function implementsInterface ( $ value , string $ interface ) : bool { if ( ! is_object ( $ value ) ) { if ( ! ( static :: classExists ( $ value ) || static :: interfaceExists ( $ value ) ) ) { return false ; } $ value = ( string ) $ value ; } $ reflection = new ReflectionClass ( $ value ) ; return $ reflection -> implementsInterface ( $ interface ) ; }
Checks if value implements a given interface

@param mixed  $value     The value
@param string $interface The fully qualified interface name

@return bool
Checks if value implements a given interface