diff --git a/src/Adapter/AdapterAbstract.php b/src/Adapter/AdapterAbstract.php index b03d47681..342b40bda 100644 --- a/src/Adapter/AdapterAbstract.php +++ b/src/Adapter/AdapterAbstract.php @@ -2,22 +2,17 @@ namespace InfluxDB\Adapter; use InfluxDB\Options; +use InfluxDB\Adapter\WritableInterface; -abstract class AdapterAbstract implements AdapterInterface +abstract class AdapterAbstract implements WritableInterface { private $options; - /** - * @param Options $options - */ public function __construct(Options $options) { $this->options = $options; } - /** - * @return Options - */ public function getOptions() { return $this->options; diff --git a/src/Adapter/AdapterInterface.php b/src/Adapter/AdapterInterface.php deleted file mode 100644 index 23bdf7a68..000000000 --- a/src/Adapter/AdapterInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -adapter = $adapter; } @@ -23,6 +24,10 @@ class Client public function mark($name, array $values = []) { + if (!($this->getAdapter() instanceOf WritableInterface)) { + throw new \BadMethodCallException("You can write data to database only if the adapter supports it!"); + } + $data = $name; if (!is_array($name)) { $data =[];