public function generate(\ReflectionClass $originalClass, string $realClassName, string $originalClassName) : string
    {
        $position = \strrpos($realClassName, '\\');
        $namespace = \substr($realClassName, 0, $position);
        $className = \substr($realClassName, $position + 1);

        $visiblePropertyMap = [];
        $hiddenPropertyMap = [];

        foreach ($this->findAllInstanceProperties($originalClass) as $property) {
            $declaringClassName = $property->getDeclaringClass()->getName();

            if ($property->isPrivate() || $property->isProtected()) {
                $hiddenPropertyMap[$declaringClassName][] = $property->getName();
            } else {
                $visiblePropertyMap[] = $property->getName();
            }
        }

        return <<<EOT
<?php

namespace {$namespace};

use Zend\Hydrator\HydratorInterface;

/**
 * This is a generated hydrator for the {$originalClassName} class
 */
class {$className} implements HydratorInterface
{
    private \$hydrateCallbacks = [];
    private \$extractCallbacks = [];

    public function __construct()
    {
        {$this->createContructor($visiblePropertyMap, $hiddenPropertyMap)}
    }

    public function hydrate(array \$data, \$object)
    {
        {$this->createHydrateMethod($visiblePropertyMap, $hiddenPropertyMap)}
    }

    public function extract(\$object)
    {
        {$this->createExtractMethod($visiblePropertyMap, $hiddenPropertyMap)}
    }
}
EOT;
    }