src/Factory/Mvc/Controller/RegistrationControllerFactory.php
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();
        /* @var $options ControllerOptionsInterface */
        $options = $services->get(ModuleOptions::class);
        /* @var $formElementManager \Zend\Form\FormElementManager */
        $formElementManager = $services->get('FormElementManager');

        return new RegistrationController(
            $services->get('DomainServiceManager')->get($options->getUserEntityClass()),
            $options,
            $formElementManager->has('CmsAuthenticationIdentity')
                ? $formElementManager->get('CmsAuthenticationIdentity')
                : null,
            $formElementManager->has('CmsAuthenticationCredential')
                ? $formElementManager->get('CmsAuthenticationCredential')
                : null
        );
    }
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();
        /* @var $options ControllerOptionsInterface */
        $options = $services->get(ModuleOptions::class);
        /* @var $formElementManager \Zend\Form\FormElementManager */
        $formElementManager = $services->get('FormElementManager');

        return new RegistrationController(
            $services->get('DomainServiceManager')->get($options->getUserEntityClass()),
            $options,
            $formElementManager->has('CmsAuthenticationIdentity')
                ? $formElementManager->get('CmsAuthenticationIdentity')
                : null,
            $formElementManager->has('CmsAuthenticationCredential')
                ? $formElementManager->get('CmsAuthenticationCredential')
                : null
        );
    }
{@inheritDoc}

@return RegistrationController