public function getArguments(array $mapping, $data, ResolveInfo $info)
    {
        $args = [];
        $exceptions = [];

        foreach ($mapping as $name => $type) {
            try {
                $value = $this->getInstanceAndValidate($type, $data[$name], $info, $name);
                $args[] = $value;
            } catch (InvalidArgumentError $exception) {
                $exceptions[] = $exception;
            }
        }

        if (!empty($exceptions)) {
            throw new InvalidArgumentsError($exceptions);
        }

        return $args;
    }
public function getArguments(array $mapping, $data, ResolveInfo $info)
    {
        $args = [];
        $exceptions = [];

        foreach ($mapping as $name => $type) {
            try {
                $value = $this->getInstanceAndValidate($type, $data[$name], $info, $name);
                $args[] = $value;
            } catch (InvalidArgumentError $exception) {
                $exceptions[] = $exception;
            }
        }

        if (!empty($exceptions)) {
            throw new InvalidArgumentsError($exceptions);
        }

        return $args;
    }
public function getArguments ( array $ mapping , $ data , ResolveInfo $ info ) { $ args = [ ] ; $ exceptions = [ ] ; foreach ( $ mapping as $ name => $ type ) { try { $ value = $ this -> getInstanceAndValidate ( $ type , $ data [ $ name ] , $ info , $ name ) ; $ args [ ] = $ value ; } catch ( InvalidArgumentError $ exception ) { $ exceptions [ ] = $ exception ; } } if ( ! empty ( $ exceptions ) ) { throw new InvalidArgumentsError ( $ exceptions ) ; } return $ args ; }
Transform a list of arguments into their corresponding php class and validate them.

@param array       $mapping
@param mixed       $data
@param ResolveInfo $info

@return array
Transform a list of arguments into their corresponding php class and validate them .