private function insertParameters($config)
    {
        foreach ($config as $k => $v) {
            if ($this->isArray($v)) {
                $config[$k] = $this->insertParameters($v);
            } elseif ($this->isString($v)) {
                $str = $this->str($v)->trim();
                if ($str->startsWith('%') && $str->endsWith('%')) {
                    $parameter = $str->trim('%')->val();
                    if (isset($this->parameters[$parameter])) {
                        $config[$k] = $this->parameters[$parameter];
                    } else {
                        throw new ServiceManagerException(ServiceManagerException::PARAMETER_NOT_FOUND, [
                                $parameter,
                                $this->serviceName
                            ]
                        );
                    }

                }
            }
        }

        return $config;
    }