protected function addWildcardRecord(ResourceRecord $resourceRecord): void
    {
        $labels = explode('.', rtrim($resourceRecord->getName(), '.'));
        $labels = array_reverse($labels);

        $array = &$this->wildcardRecords;
        foreach ($labels as $label) {
            if ('*' === $label) {
                $array[$label][$resourceRecord->getClass()][$resourceRecord->getType()][] = $resourceRecord;
                break;
            }

            $array = &$array[$label];
        }
    }