Update aggregated coverage

@param string $class
@param array  $counts
765934
public function update($class, array $counts)
    {
        if (! isset($this->coverage[$class])) {
            $this->coverage[$class] = $counts;

            return;
        }

        foreach ($counts as $line => $status) {
            if (! isset($this->coverage[$class][$line]) || $status > 0) {
                // converts "hits" to "status"
                $status = ! $status ? -1 : ($status > 1 ? 1 : $status);

                $this->coverage[$class][$line] = $status;
            }
        }
    }
1166803
public function setCount(int $count, string $type = self::INFO): void
	{
		if ($count > 0) {
			switch ($type) {
				default:
					throw new InvalidArgumentException("Wrong argument 'type'");
				case self::INFO:
				case self::WARNING:
					break;
			}
			$this->count = $count;
			$this->type = $type;
		}
	}
962304
public function updateCMSTreeClasses(&$classes)
    {
        if ($this->owner->getField('Disabled')) {
            $classes .= ' is-disabled';
        } elseif ($this->owner->getField('Cached')) {
            $classes .= ' is-cached';
        }
    }
382130
protected function updateSubclassInterfacesTraits($class)
    {
        foreach ($class->subclasses as $subclass) {
            $subclass = $this->classes[$subclass];
            $subclass->interfaces = array_unique(array_merge($subclass->interfaces, $class->interfaces));
            $subclass->traits = array_unique(array_merge($subclass->traits, $class->traits));
            $this->updateSubclassInterfacesTraits($subclass);
        }
    }
1316157
public function set_count($try, $count) {
        $this->totalcount = $this->totalcount + $count;
        $this->trycount[$try] = $count;
    }
1210504
public function updateClassNames(&$classes)
    {
        // Update Class Names (via parent):
        
        parent::updateClassNames($classes);
        
        // Update Class Names:
        
        if ($this->owner->isEdgeToEdge()) {
            $classes[] = $this->style('column.edge-to-edge');
        }
    }
890689
void updateCount() {
		if (this.hasChanged) {
			this.countArray = ArrayUtils.toPrimitive(getCountList().toArray(
					new Long[0]));
			this.hasChanged = false;
		}
	}
446954
protected function buildShuffleProfileUpdatesPayload($count, $utc)
    {
        $payload = array();

        if (is_numeric($count)) {
            $payload['count'] = $count;
        }

        if ($utc) {
            $payload['utc'] = true;
        }

        return $payload;
    }
357537
public function addColumn($fieldsets, $class = null)
    {
        if (!is_array($fieldsets)) {
            $fieldsets = [$fieldsets];
        }
        foreach ($fieldsets as $i => $num) {
            $fieldsets[$i] = (int)$num - 1;
        }
        if (null === $class) {
            $class = 'pop-form-column-' . (count($this->columns) + 1);
        }
        $this->columns[$class] = $fieldsets;
        return $this;
    }
935200
def update_one_time_key_counts(self, counts):
        
        self.one_time_keys_manager.server_counts = counts
        if self.one_time_keys_manager.should_upload():
            logger.info('Uploading new one-time keys.')
            self.upload_one_time_keys()
744622
private function collectStatement(array $start, array $end, int $coverage = 0) : void
    {
        $this->fileCoverage['statementMap'][] = [
            'start' => $start,
            'end' => $end,
        ];

        $this->fileCoverage['s'][] = $coverage;
    }
928122
public function updateTotals()
    {
        foreach ($this->totals_plan as $key => $val) {

            // if value is array, then we treat it as built-in or callable aggregate method
            if (is_array($val)) {
                $f = $val[0]; // shortcut

                // initial value is always 0
                if (!isset($this->totals[$key])) {
                    $this->totals[$key] = 0;
                }

                // closure support
                // arguments - current value, key, \atk4\ui\Table object
                if ($f instanceof \Closure) {
                    $this->totals[$key] += ($f($this->model[$key], $key, $this) ?: 0);
                }
                // built-in methods
                elseif (is_string($f)) {
                    switch ($f) {
                        case 'sum':
                            $this->totals[$key] += $this->model[$key];
                            break;
                        case 'count':
                            $this->totals[$key] += 1;
                            break;
                        case 'min':
                            if ($this->model[$key] < $this->totals[$key]) {
                                $this->totals[$key] = $this->model[$key];
                            }
                            break;
                        case 'max':
                            if ($this->model[$key] > $this->totals[$key]) {
                                $this->totals[$key] = $this->model[$key];
                            }
                            break;
                        default:
                            throw new Exception(['Aggregation method does not exist', 'method' => $f]);
                    }
                }
            }
        }
    }
1155178
public function incrementCount($tag, $count)
	{
		if($count <= 0) { return; }

		$tag->count = $tag->count + $count;
		$tag->save();
	}
1105166
public static function observe($class)
    {
        foreach (static::$observe as $event) {
            $eventFuncName = Db::parseName($event, 1, false);

            if (method_exists($class, $eventFuncName)) {
                static::event($event, [$class, $eventFuncName]);
            }
        }
    }
1338872
public static function count($count, array $options = []) {

        // TODO: Refactor the options to a dedicated config file.
        $classes = Arr::get($options, 'classes', [
            'positive' => 'label label-info',
            'zero'     => 'label label-default',
            'negative' => 'label label-danger',
        ]);

        return static::generate($count, [
            'class' => $count > 0 ? $classes['positive'] : ($count < 0 ? $classes['negative'] : $classes['zero'])
        ]);
    }
584371
public function outputFileCount(int $count): void
    {
        if (OutputInterface::VERBOSITY_NORMAL === $this->io->getVerbosity()) {
            $this->progressBar = $this->io->createProgressBar($count);
            $this->progressBar->start();
        } elseif ($this->io->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $this->progressBar = new ProgressBar(new NullOutput());
        }
    }
247719
public function update_status($instance, $newstatus) {
        global $DB;

        $instance->status = $newstatus;
        $DB->update_record('enrol', $instance);

        $context = context_course::instance($instance->courseid);
        \core\event\enrol_instance_updated::create_from_record($instance)->trigger();

        // Invalidate all enrol caches.
        $context->mark_dirty();
    }