public function __construct($type) { if (!in_array($type, self::getPossibleTypes())) { throw InvalidModuleExtraType::withType($type); } $this->type = $type; }