Dimension.php in Googalytics - Google Analytics 8
File
src/AnalyticsCommand/Dimension.php
View source
<?php
namespace Drupal\ga\AnalyticsCommand;
class Dimension extends Set {
public function __construct($index, $value, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
if (!is_int($index)) {
if (!is_string($index) || !ctype_digit($index)) {
throw new \InvalidArgumentException("Dimension index must be an integer between 0 and 199");
}
$index = (int) $index;
}
if ($index < 0 || $index >= 200) {
throw new \InvalidArgumentException("Dimension index must be an integer between 0 and 199");
}
parent::__construct('dimension' . $index, $value, $fields_object, $tracker_name, $priority);
}
}