protected static function make($verb, $urls, $data, callable $callback = null)
    {
        if (!is_array($urls)) {
            $urls = [$urls => $data];
        } elseif (!(bool)count(array_filter(array_keys($urls), 'is_string'))) {
            foreach ($urls as $key => $url) {
                $urls[$url] = null;
                unset($urls[$key]);
            }
        }

        $dispatcher = new Dispatcher;
        $requests   = [];
        $dataStore  = [];

        foreach ($urls as $url => $data) {
            $requests[]  = new Request($url);
            $dataStore[] = $data;
        }

        new static($verb, $dispatcher, $requests, $dataStore, $callback);

        $requests  = $dispatcher->all();
        $responses = [];

        foreach ($requests as $request) {
            $responses[] = $request->getResponse();
        }

        return $responses;
    }
protected static function make($verb, $urls, $data, callable $callback = null)
    {
        if (!is_array($urls)) {
            $urls = [$urls => $data];
        } elseif (!(bool)count(array_filter(array_keys($urls), 'is_string'))) {
            foreach ($urls as $key => $url) {
                $urls[$url] = null;
                unset($urls[$key]);
            }
        }

        $dispatcher = new Dispatcher;
        $requests   = [];
        $dataStore  = [];

        foreach ($urls as $url => $data) {
            $requests[]  = new Request($url);
            $dataStore[] = $data;
        }

        new static($verb, $dispatcher, $requests, $dataStore, $callback);

        $requests  = $dispatcher->all();
        $responses = [];

        foreach ($requests as $request) {
            $responses[] = $request->getResponse();
        }

        return $responses;
    }
protected static function make ( $ verb , $ urls , $ data , callable $ callback = null ) { if ( ! is_array ( $ urls ) ) { $ urls = [ $ urls => $ data ] ; } elseif ( ! ( bool ) count ( array_filter ( array_keys ( $ urls ) , 'is_string' ) ) ) { foreach ( $ urls as $ key => $ url ) { $ urls [ $ url ] = null ; unset ( $ urls [ $ key ] ) ; } } $ dispatcher = new Dispatcher ; $ requests = [ ] ; $ dataStore = [ ] ; foreach ( $ urls as $ url => $ data ) { $ requests [ ] = new Request ( $ url ) ; $ dataStore [ ] = $ data ; } new static ( $ verb , $ dispatcher , $ requests , $ dataStore , $ callback ) ; $ requests = $ dispatcher -> all ( ) ; $ responses = [ ] ; foreach ( $ requests as $ request ) { $ responses [ ] = $ request -> getResponse ( ) ; } return $ responses ; }
Make one or multiple requests.

@param string $verb
@param mixed $urls
@param mixed $data
@param callable $callback
@return array
Make one or multiple requests .