lib/DefaultResolver.php
// flatten $result while preserving order according to $types (append unspecified types for e.g. Record::ALL queries)
flatten $result while preserving order according to $types (append unspecified types for e.g. Record::ALL queries)
flatten $result while preserving order according to $types ( append unspecified types for e . g . Record :: ALL queries )
private function pipeResult($promise, array $types) {
        return \Amp\pipe($promise, function (array $result) use ($types) {
            $retval = [];
            foreach ($types as $type) {
                if (isset($result[$type])) {
                    $retval = \array_merge($retval, $result[$type]);
                    unset($result[$type]);
                }
            }
            return $result ? \array_merge($retval, \call_user_func_array("array_merge", $result)) : $retval;
        });
    }
private function pipeResult ( $ promise , array $ types ) { return \ Amp \ pipe ( $ promise , function ( array $ result ) use ( $ types ) { $ retval = [ ] ; foreach ( $ types as $ type ) { if ( isset ( $ result [ $ type ] ) ) { $ retval = \ array_merge ( $ retval , $ result [ $ type ] ) ; unset ( $ result [ $ type ] ) ; } } return $ result ? \ array_merge ( $ retval , \ call_user_func_array ( " array_merge " , $ result ) ) : $ retval ; } ) ; }
flatten $result while preserving order according to $types (append unspecified types for e.g.
flatten $result while preserving order according to $types ( append unspecified types for e . g .