protected function addThemes(Theme $theme, $config)
    {
        if (!is_array($config) && !($config instanceof \Traversable)) {
            return $this;
        }

        foreach ($config as $name => $conf) {
            if (!isset($conf['path'])) {
                continue;
            }

            $theme->addLocation($name, $conf['path']);
        }

        return $this;
    }