public static function resolve(array $parameters, $context = null)
    {
        $params = [];
        foreach ($parameters as $key => $value) {
            if ($value instanceof Reference) {
                $val = $value->getValue();
                if (isset($context[$val])) {
                    $params[$key] = $context[$val];
                } else {
                    throw new RuntimeException('Reference invalid context key "' . $val . '"');
                }
            } else {
                $params[$key] = $value;
            }
        }

        return $params;
    }
public static function resolve(array $parameters, $context = null)
    {
        $params = [];
        foreach ($parameters as $key => $value) {
            if ($value instanceof Reference) {
                $val = $value->getValue();
                if (isset($context[$val])) {
                    $params[$key] = $context[$val];
                } else {
                    throw new RuntimeException('Reference invalid context key "' . $val . '"');
                }
            } else {
                $params[$key] = $value;
            }
        }

        return $params;
    }
public static function resolve ( array $ parameters , $ context = null ) { $ params = [ ] ; foreach ( $ parameters as $ key => $ value ) { if ( $ value instanceof Reference ) { $ val = $ value -> getValue ( ) ; if ( isset ( $ context [ $ val ] ) ) { $ params [ $ key ] = $ context [ $ val ] ; } else { throw new RuntimeException ( 'Reference invalid context key "' . $ val . '"' ) ; } } else { $ params [ $ key ] = $ value ; } } return $ params ; }
Resolves parameters agains a context

@param array $parameters
@param array $context
@return array
Resolves parameters agains a context