package de.espend.idea.shopware.symfony.service;

import de.espend.idea.shopware.ShopwareProjectComponent;
import fr.adrienbrault.idea.symfony2plugin.extension.ServiceCollector;
import fr.adrienbrault.idea.symfony2plugin.extension.ServiceCollectorParameter;
import org.jetbrains.annotations.NotNull;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public class DefaultServiceCollector implements ServiceCollector {

    private static Map<String, String> DEFAULTS = new HashMap<String, String>() {{
        put("bootstrap", "Shopware_Bootstrap");
        put("application", "Shopware");
    }};

    @Override
    public void collectServices(@NotNull ServiceCollectorParameter.Service parameter) {
        if(!ShopwareProjectComponent.isValidForProject(parameter.getProject())) {
            return;
        }

        DEFAULTS.forEach(parameter::add);
    }

    @Override
    public void collectIds(@NotNull ServiceCollectorParameter.Id parameter) {
        parameter.addAll(DEFAULTS.keySet());
    }
}

@@ -641,24 +641,116 @@
 Shopware%22);%0A
+        put(%22shop%22, %22Shopware%5C%5CModels%5C%5CShop%5C%5CShop%22);%0A        put(%22db_connection%22, %22%5C%5CPDO%22);%0A
     %7D%7D;%0A%0A   

Revert "revert "Extend default services #78""