Version 1
[yaffs-website] / vendor / jcalderonzumba / gastonjs / src / Exception / InvalidSelector.php
diff --git a/vendor/jcalderonzumba/gastonjs/src/Exception/InvalidSelector.php b/vendor/jcalderonzumba/gastonjs/src/Exception/InvalidSelector.php
new file mode 100644 (file)
index 0000000..44fad4b
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+namespace Zumba\GastonJS\Exception;
+
+/**
+ * Class InvalidSelector
+ * @package Zumba\GastonJS\Exception
+ */
+class InvalidSelector extends ClientError {
+  /**
+   * Gets the method of selection
+   * @return string
+   */
+  public function getMethod() {
+    return $this->response["error"]["args"][0];
+  }
+
+  /**
+   * Gets the selector related to the method
+   * @return string
+   */
+  public function getSelector() {
+    return $this->response["error"]["args"][1];
+  }
+
+  /**
+   * @return string
+   */
+  public function message() {
+    return "The browser raised a syntax error while trying to evaluate" . $this->getMethod() . " selector " . $this->getSelector();
+  }
+}