MediaWiki master
ConfirmEmailBuilderFactory.php
Go to the documentation of this file.
1<?php
2
4
10
12
16 public const CONSTRUCTOR_OPTIONS = [
18 ];
19
20 public function __construct(
21 private readonly ServiceOptions $options,
22 private readonly BagOStuff $cache,
23 private readonly UrlUtils $urlUtils
24 ) {
25 $this->options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
26 }
27
29 if ( $this->options->get( MainConfigNames::UserEmailConfirmationUseHTML ) ) {
30 return new HTMLConfirmEmailBuilder(
31 $ctx,
32 $this->cache,
33 $this->urlUtils
34 );
35 } else {
36 return new PlaintextConfirmEmailBuilder( $ctx );
37 }
38 }
39}
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:69
A class for passing options to services.
__construct(private readonly ServiceOptions $options, private readonly BagOStuff $cache, private readonly UrlUtils $urlUtils)
A class containing constants representing the names of configuration variables.
const UserEmailConfirmationUseHTML
Name constant for the UserEmailConfirmationUseHTML setting, for use with Config::get()
A service to expand, parse, and otherwise manipulate URLs.
Definition UrlUtils.php:16
Abstract class for any ephemeral data store.
Definition BagOStuff.php:73
Interface for objects which can provide a MediaWiki context on request.
A service that is able to build a user email address confirmation e-mail.