public function setPriority(int $priority) : self
{
static $priorities = [self::PRIORITY_HIGHEST => true, self::PRIORITY_HIGH => true, self::PRIORITY_NORMAL => true, self::PRIORITY_LOW => true, self::PRIORITY_LOWEST => true];
if (!isset($priorities[$priority])) {
throw new \InvalidArgumentException(sprintf('Unknown priority %s', $priority));
}
$this->priority = (int) $priority;
return $this;
}