/** * (@inheritdoc) */ public function deserialize($type, array $data) { if ($data instanceof \ArrayObject) { $data = $data->getArrayCopy(); } if (is_object($type)) { $type = get_class($type); } if ($this->handler->canDeserialize($type)) { return $this->handler->deserialize($type, $data); } $reflectionClass = new \ReflectionClass($type); $object = $reflectionClass->newInstanceWithoutConstructor(); $object = $this->setReflectionPropertiesFromData($data, $reflectionClass, $object); return $object; }
private function subDeserialize($type, $data) { if ($data instanceof \ArrayObject) { $data = $data->getArrayCopy(); } if ($this->handler->canDeserialize($type, $data)) { return $this->handler->deserialize($type, $data); } return $this->deserialize($type, $data); }
/** @expectedException Monii\Serialization\ReflectionPropertiesSerializer\PropertyTypeWasNotDefined */ public function testPropertyWasNotDefinedException() { $input = new NoTypehint(); $reflectionSerializer = new ReflectionPropertiesSerializer(); $reflectionSerializer->serialize($input); }