Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CustomDimensions/Dimension/Active.php')
m---------plugins/CustomDimensions0
-rw-r--r--plugins/CustomDimensions/Dimension/Active.php31
2 files changed, 31 insertions, 0 deletions
diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions
deleted file mode 160000
-Subproject 318661a2fb1ef3b3e5d6d999ae8b9628cb5a113
diff --git a/plugins/CustomDimensions/Dimension/Active.php b/plugins/CustomDimensions/Dimension/Active.php
new file mode 100644
index 0000000000..7de60dbd38
--- /dev/null
+++ b/plugins/CustomDimensions/Dimension/Active.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Plugins\CustomDimensions\Dimension;
+
+use \Exception;
+
+class Active
+{
+ private $active;
+
+ public function __construct($active)
+ {
+ $this->active = $active;
+ }
+
+ public function check()
+ {
+ if (!is_bool($this->active) && !in_array($this->active, array('0', '1', 0, 1), true)) {
+ $active = $this->active;
+ throw new Exception("Invalid value '$active' for 'active' specified. Allowed values: '0' or '1'");
+ }
+ }
+
+} \ No newline at end of file