public function createDelegatorWithName(
        ServiceLocatorInterface $serviceLocator,
        $name,
        $requestedName,
        $callback
    ) {
        $mapper = $callback();

        if (!$mapper instanceof UserMapperInterface) {
            return $mapper;
        }

        $services = $serviceLocator->getServiceLocator();

        /* @var $options ModuleOptions */
        $options = $services->get(ModuleOptions::class);

        $mapper->setIdentityFields($options->getIdentityFields());

        /* @var $passwordService \Zend\Crypt\Password\PasswordInterface */
        $passwordService = $services->get($options->getPasswordService());
        $mapper->setPasswordService($passwordService);

        return $mapper;
    }
public function createDelegatorWithName(
        ServiceLocatorInterface $serviceLocator,
        $name,
        $requestedName,
        $callback
    ) {
        $mapper = $callback();

        if (!$mapper instanceof UserMapperInterface) {
            return $mapper;
        }

        $services = $serviceLocator->getServiceLocator();

        /* @var $options ModuleOptions */
        $options = $services->get(ModuleOptions::class);

        $mapper->setIdentityFields($options->getIdentityFields());

        /* @var $passwordService \Zend\Crypt\Password\PasswordInterface */
        $passwordService = $services->get($options->getPasswordService());
        $mapper->setPasswordService($passwordService);

        return $mapper;
    }
{@inheritDoc}

@return MapperInterface