whitelisted = $whitelistedValues; } public function validate($value) { if (!in_array($value, $this->whitelisted, true)) { throw new Exception(Piwik::translate('General_ValidatorErrorXNotWhitelisted', array($value, implode(', ', $this->whitelisted)))); } } }