public function deserializeParameters($type, $data)
    {
        $jobType = $this->registry->get($type);
        $indices = $jobType->getIndicesOfSerializableParameters();

        $serializedParameters = json_decode($data, 1);
        if (false === $serializedParameters) {
            throw new \RuntimeException(sprintf('Deserialization failed with error "%s"', json_last_error_msg()));
        }

        if (count($indices) < count($serializedParameters)) {
            throw new \InvalidArgumentException(sprintf('The serialized data contains more parameters than defined for job "%s"', $type));
        }

        $parameters = array();
        foreach ($serializedParameters as $index => $data) {
            if (null === $data) {
                $parameters[] = null;
            } else {
                $parameters[] = $this->serializer->deserialize($data, $jobType->getParameterType($indices[$index]), 'json', $this->getParamDeserializationContext($jobType, $indices[$index]));
            }
        }

        return $parameters;
    }
public function deserializeParameters($type, $data)
    {
        $jobType = $this->registry->get($type);
        $indices = $jobType->getIndicesOfSerializableParameters();

        $serializedParameters = json_decode($data, 1);
        if (false === $serializedParameters) {
            throw new \RuntimeException(sprintf('Deserialization failed with error "%s"', json_last_error_msg()));
        }

        if (count($indices) < count($serializedParameters)) {
            throw new \InvalidArgumentException(sprintf('The serialized data contains more parameters than defined for job "%s"', $type));
        }

        $parameters = array();
        foreach ($serializedParameters as $index => $data) {
            if (null === $data) {
                $parameters[] = null;
            } else {
                $parameters[] = $this->serializer->deserialize($data, $jobType->getParameterType($indices[$index]), 'json', $this->getParamDeserializationContext($jobType, $indices[$index]));
            }
        }

        return $parameters;
    }
public function deserializeParameters ( $ type , $ data ) { $ jobType = $ this -> registry -> get ( $ type ) ; $ indices = $ jobType -> getIndicesOfSerializableParameters ( ) ; $ serializedParameters = json_decode ( $ data , 1 ) ; if ( false === $ serializedParameters ) { throw new \ RuntimeException ( sprintf ( 'Deserialization failed with error "%s"' , json_last_error_msg ( ) ) ) ; } if ( count ( $ indices ) < count ( $ serializedParameters ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The serialized data contains more parameters than defined for job "%s"' , $ type ) ) ; } $ parameters = array ( ) ; foreach ( $ serializedParameters as $ index => $ data ) { if ( null === $ data ) { $ parameters [ ] = null ; } else { $ parameters [ ] = $ this -> serializer -> deserialize ( $ data , $ jobType -> getParameterType ( $ indices [ $ index ] ) , 'json' , $ this -> getParamDeserializationContext ( $ jobType , $ indices [ $ index ] ) ) ; } } return $ parameters ; }
Deserializes the parameters of a job.

@param string $type The job type
@param string $data The serialized parameters
@return array The deserialized parameters
@throws \InvalidArgumentException If no serializable parameters are defined for the job type
Deserializes the parameters of a job .