public function hydrate(array $data, $objectOrClass, array $map = null)
    {
        if (\is_object($objectOrClass)) {
            $object = $objectOrClass;
            $reflection = $this->getReflection(\get_class($object));
        } else {
            $reflection = $this->getReflection($objectOrClass);
            $object = $reflection->newInstanceWithoutConstructor();
        }

        if (!\is_array($map) || !$map) {
            $map = \array_keys($data);
            $map = \array_combine($map, $map);
        }
        foreach ($map as $fieldName => $propertyName) {
            if (isset($data[$fieldName]) && $reflection->hasProperty($propertyName)) {
                $property = $this->getProperty($reflection, $propertyName);
                $property->setValue($object, $data[$fieldName]);
            }
        }

        return $object;
    }