src/Executor/ReferenceExecutor.php
private function promiseForAssocArray(array $assoc)
    {
        $keys              = array_keys($assoc);
        $valuesAndPromises = array_values($assoc);
        $promise           = $this->exeContext->promises->all($valuesAndPromises);

        return $promise->then(static function ($values) use ($keys) {
            $resolvedResults = [];
            foreach ($values as $i => $value) {
                $resolvedResults[$keys[$i]] = $value;
            }

            return self::fixResultsIfEmptyArray($resolvedResults);
        });
    }
private function promiseForAssocArray(array $assoc)
    {
        $keys              = array_keys($assoc);
        $valuesAndPromises = array_values($assoc);
        $promise           = $this->exeContext->promises->all($valuesAndPromises);

        return $promise->then(static function ($values) use ($keys) {
            $resolvedResults = [];
            foreach ($values as $i => $value) {
                $resolvedResults[$keys[$i]] = $value;
            }

            return self::fixResultsIfEmptyArray($resolvedResults);
        });
    }
private function promiseForAssocArray ( array $ assoc ) { $ keys = array_keys ( $ assoc ) ; $ valuesAndPromises = array_values ( $ assoc ) ; $ promise = $ this -> exeContext -> promises -> all ( $ valuesAndPromises ) ; return $ promise -> then ( static function ( $ values ) use ( $ keys ) { $ resolvedResults = [ ] ; foreach ( $ values as $ i => $ value ) { $ resolvedResults [ $ keys [ $ i ] ] = $ value ; } return self :: fixResultsIfEmptyArray ( $ resolvedResults ) ; } ) ; }
This function transforms a PHP `array<string, Promise|scalar|array>` into
a `Promise<array<key,scalar|array>>`

In other words it returns a promise which resolves to normal PHP associative array which doesn't contain
any promises.

@param (string|Promise)[] $assoc

@return mixed
This function transforms a PHP array<string Promise|scalar|array > into a Promise<array<key scalar|array >>