protected function addLocalResource(ResourceSettings $settings): bool
    {
        $settings->repositoryKey = $this->getLocalResourceRepositoryKey($settings);

        if ($this->resources->has($settings->repositoryKey)) {
            ++$settings->order;

            return $this->addLocalResource($settings);
        }

        $this->resources->add($settings->repositoryKey, $settings);

        $compileKey = $this->getCompiledLocalResourceRepositoryKey($settings);

        if (!$this->resources->has($compileKey)) {
            $this->resources->add($compileKey, '');
        }

        $this->resources[$compileKey] .= $this->crc($settings->filename . $settings->theme->getKey() . $settings->mtime);

        return true;
    }