. */ /** * For more information, please contact */ namespace Goat1000\SVGGraph; /** * Abstract class implements common methods */ abstract class ColourRange implements \ArrayAccess { protected $count = 2; /** * Sets up the length of the range */ public function setup($count) { $this->count = $count; } /** * always true, because it wraps around */ #[\ReturnTypeWillChange] public function offsetExists($offset) { return true; } #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \Exception('Unexpected offsetSet'); } #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new \Exception('Unexpected offsetUnset'); } /** * Clamps a value to range $min-$max */ protected static function clamp($val, $min, $max) { return min($max, max($min, $val)); } }