private function traverse(array $registry): array
    {
        foreach ($registry as &$value) {
            switch (true) {
                case is_array($value):
                    $value = $this->traverse($value);
                    break;

                case is_string($value):
                    $value = $this->replace($value);
                    break;
            }
        }

        return $registry;
    }