package de.espend.idea.php.toolbox.provider;

import de.espend.idea.php.toolbox.extension.JsonStreamResource;
import de.espend.idea.php.toolbox.utils.ExtensionProviderUtil;
import org.jetbrains.annotations.NotNull;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public class InternalJsonStreamResource implements JsonStreamResource {
    @NotNull
    @Override
    public Collection<InputStream> getInputStreams() {
        Collection<InputStream> inputStreams = new ArrayList<>();

        // not scanning directory; performance because we are inside .jar file
        String[] strings = {
            "behat",
            "core",
            "doctrine/common",
            "doctrine/orm",
            "http",
            "mockery",
            "phpunit",
            "symfony/browserkit",
            "symfony/form",
            "symfony/framework-bundle",
            "symfony/http-foundation",
            "twig"
        };

        for (String s : strings) {
            InputStream stream = ExtensionProviderUtil.class.getClassLoader()
                .getResourceAsStream("resources/json/" + s + "/.ide-toolbox.metadata.json");

            if (stream == null) {
                continue;
            }

            inputStreams.add(stream);
        }

        return inputStreams;
    }
}

@@ -830,16 +830,88 @@
 ckery%22,%0A
+            %22php-http/message-factory%22,%0A            %22psr/http-message%22,%0A
         
@@ -955,24 +955,54 @@
 rowserkit%22,%0A
+            %22symfony/config%22,%0A
             

add path for new static resources