public function buildFromConfigArray(array $config)
    {
        $dsm = new DataSourceManager();

        foreach ($config as $dataSourceName => $data) {
            if (false === isset($data['class'])) {
                throw new \RuntimeException(sprintf('Expected param "class" at the configuration of the data source: "%s".', $dataSourceName));
            }

            $classname = $data['class'];
            $arguments = true === isset($data['arguments']) ? $data['arguments'] : [];

            if (count($this->parameterKeys) > 0 && count($arguments) > 0) {
                $arguments = $this->resolveArgumentsParameters($arguments);
            }

            if (false === class_exists($classname)) {
                throw new \RuntimeException(sprintf('Data source "%s" class not found: "%s".', $dataSourceName, $classname));
            }

            $ds = new $classname($arguments);
            $dsm->addDataSource($dataSourceName, $ds);
        }

        return $dsm;
    }