Checks if the tag occurrences reaches their minimum counts.

@return void
353255
private function checkAndRegisterTagMinimumCounts(): void
    {
        $checkedRule = 'min';
        $rulesWithReq = $this->getRulesWithRequirement($checkedRule);

        array_walk(
            $rulesWithReq,
            function (array $tagRule, string $tag) use ($checkedRule): void {
                $minCount = $tagRule[$checkedRule];
                $tagCount = count($this->findTokensForTag($tag));

                if ($minCount > $tagCount) {
                    $fixCallback = $this->hasFixCallback($checkedRule, $tag);
                    $method = $fixCallback ? 'addFixableError' : 'addError';
                    $fixable = $this->file->{$method}(
                        self::MESSAGE_TAG_OCCURRENCE_MIN,
                        $this->getDocCommentPos(),
                        // We use an error code containing the tag name because we can't configure this rules from the
                        // outside and need  specific code to exclude the rule for this special tag.
                        static::CODE_TAG_OCCURRENCE_MIN_PREFIX . ucfirst($tag),
                        [
                            $tag,
                            $minCount,
                            $tagCount
                        ]
                    );

                    if ($fixable && $fixCallback) {
                        $this->{$fixCallback}($this->getDocCommentPos(), $minCount, $tagCount, $tag);
                    }
                }
            }
        );
    }
784674
public function hasTooManyLoginAttempts()
    {
        return $this->cacheLimiter->tooManyAttempts(
            $this->getUniqueLoginKey(),
            $this->maxLoginAttempts(),
            $this->lockoutTime() / 60
        );
    }
449869
public function clear(): bool
    {
        if (!empty($this->tag)) {
            foreach ($this->tag as $tag) {
                $this->clearTag($tag);
            }
            return true;
        }

        $this->writeTimes++;

        $this->handler->flushDB();
        return true;
    }
20955
protected function addTagRules()
	{
		// Get the rules
		$rules = $this->rulesGenerator->getRules($this->tags);

		// Add the rules pertaining to the root
		$this->rootRules->merge($rules['root'], false);

		// Add the rules pertaining to each tag
		foreach ($rules['tags'] as $tagName => $tagRules)
		{
			$this->tags[$tagName]->rules->merge($tagRules, false);
		}
	}
384683
protected function checkForMorePages()
	{
		$this->hasMore = count( $this->items ) > ( $this->perPage );

		$this->items = $this->items->slice( 0, $this->perPage );
	}
823760
protected function ensureAppended()
    {
        if (!$this->_appended) {
            $this->_parentElement->getDOM()->appendChild($this->_element);
            $this->_appended = true;
            $this->_parentElement->ensureAppended();
        }
    }
408085
public static function validate($tags)
    {
        if (\count($tags) > self::$maxVideoTagTags || 0 === \count($tags)) {
            return false;
        }

        return $tags;
    }
478490
function() {
    for (var i = this.notSelfClosingTags.length - 1; i >= 0; i--) {
      if (this.tagName == this.notSelfClosingTags[i]) return false;
    }

    return true;
  }
486410
public function clear(): bool
    {
        if (!empty($this->tag)) {
            foreach ($this->tag as $tag) {
                $this->clearTag($tag);
            }
            return true;
        }

        $this->writeTimes++;

        $sql = 'DELETE FROM ' . $this->options['table'];

        sqlite_query($this->handler, $sql);

        return true;
    }
1307644
private function record_tag($tag)
    {
        if (isset($this->tags[$tag . 'count'])) { //check for the existence of this tag type
            $this->tags[$tag . 'count']++;
            $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level
        } else { //otherwise initialize this tag type
            $this->tags[$tag . 'count'] = 1;
            $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level
        }
        $this->tags[$tag . $this->tags[$tag . 'count'] . 'parent'] = $this->tags['parent']; //set the parent (i.e. in the case of a div this.tags.div1parent)
        $this->tags['parent'] = $tag . $this->tags[$tag . 'count']; //and make this the current parent (i.e. in the case of a div 'div1')
    }
1025241
public static function hasTags()
    {
        if (Config::get('store') == 'global') {
            return count(self::$_tagStore);
        } elseif (Config::get('store') == 'internal') {
            return count(Config::getHTMLInstance()->tagStore);
        }
    }
70866
public function pairWith(Tag $tag)
	{
		if ($this->name === $tag->name)
		{
			if ($this->type === self::START_TAG
			 && $tag->type  === self::END_TAG
			 && $tag->pos   >=  $this->pos)
			{
				$this->endTag  = $tag;
				$tag->startTag = $this;

				$this->cascadeInvalidationTo($tag);
			}
			elseif ($this->type === self::END_TAG
			     && $tag->type  === self::START_TAG
			     && $tag->pos   <=  $this->pos)
			{
				$this->startTag = $tag;
				$tag->endTag    = $this;
			}
		}
	}
1223373
private function checkValidity()
    {

        if (!is_writable($this->rssFile)) {
            $this->valid = false;
            return;
        }

        $stmt = $this->db->prepare('SELECT CREATED FROM ' . $this->table . ' ORDER BY CREATED DESC LIMIT 1');
        $stmt->execute();
        $res = $stmt->fetchAll();

        if (count($res) == 0) {
            $this->valid = false;
            return;
        }

        $latestInput = strtotime($res[0]->CREATED);

        $rssCreated = filemtime($this->rssFile);

        if ($latestInput > $rssCreated) {
            $this->valid = false;
        } else {
            $this->valid = true;
        }
    }
656364
public function validate() {

		$result = parent::validate();

		// Confirm that the current search suggestion matches the minimum autocomplete length and doesn't already exist.

		if($result->isValid() && (strlen($this->Term) < 3)) {
			$result->addError('Minimum autocomplete length required!');
		}
		else if($result->isValid() && ExtensibleSearchSuggestion::get_one(ExtensibleSearchSuggestion::class, array(
			'ID != ?' => (int)$this->ID,
			'Term = ?' => $this->Term,
			'ExtensibleSearchPageID = ?' => $this->ExtensibleSearchPageID
		))) {
			$result->addError('Suggestion already exists!');
		}

		// Allow extension customisation.

		$this->extend('validateExtensibleSearchSuggestion', $result);
		return $result;
	}
1024155
protected function _minLength()
	{
		$limit = $this->getMinLength();
		if ($limit !== null) {
			$i = 0;
			$_tagsArray = array();
			foreach ($this->_tagsArray as $key => $value) {
				if (strlen($value['tag']) >= $limit) {
					$_tagsArray[$value['tag']] = $value;
				}
				$i++;
			}
			$this->_tagsArray = array();
			$this->_tagsArray = $_tagsArray;
		}
		return $this->_tagsArray;
	}
512979
protected function isMatching()/*# : bool */
    {
        if (empty($this->tags)) {
            return true;
        } else {
            return $this->getContainer()->hasTag($this->tags);
        }
    }
356040
public function on_elements_end() {

        $numofrubrics = 0;
        foreach ($this->rubrics as $itemid => $levels) {
            $numofrubrics += count($levels);
        }

        if ($numofrubrics == 0) {
            $this->convert_legacy_criterion_elements();

        } else {
            $this->convert_legacy_rubric_elements();
        }
    }