/**
* Setter for the type argument
*
* @param integer $value The constant from VIEW_TYPE
*
* @return mixed
*
* @throws BadMethodCallException if the argument is not of the expected type
*/
protected function setType($value)
{
if (!in_array($value, [static::ITEM, static::LIST])) {
throw new BadMethodCallException("Argument 'type' of event {$this->name} must be a valid value");
}
return $value;
}