private function checkAndRegisterDisallowedTagsError(): void
    {
        $disallowedTags = $this->getDisallowedTags();
        $tags = $this->getAllTags();

        foreach ($tags as $tagPos => $tag) {
            $tagContent = $tag['content'];

            if (in_array(substr($tagContent, 1), $disallowedTags)) {
                $this->file->addError(
                    self::MESSAGE_TAG_NOT_ALLOWED,
                    $tagPos,
                    static::CODE_TAG_NOT_ALLOWED,
                    [$tagContent]
                );
            }
        }
    }