Passed
Push — master ( 61a69a...b72cbf )
by Aimeos
29:15 queued 16:02
created

Typo3   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2024
6
 * @package Base
7
 * @subpackage Mail
8
 */
9
10
11
namespace Aimeos\Base\Mail\Manager;
12
13
14
/**
15
 * TYPO3 mail manager
16
 *
17
 * @package Base
18
 * @subpackage Mail
19
 */
20
class Typo3 implements Iface
21
{
22
	private \Closure $closure;
23
24
	/**
25
	 * Initializes the instance of the class.
26
	 *
27
	 * @param \Closure $closure Closure generating TYPO3 mail message objects
28
	 */
29
	public function __construct( \Closure $closure )
30
	{
31
		$this->closure = $closure;
32
	}
33
34
35
	/**
36
	 * Returns the mailer for the given name
37
	 *
38
	 * @param string $name Key for the mailer
39
	 * @return \Aimeos\Base\Mail\Iface Mail object
40
	 * @throws \Aimeos\Base\Mail\Exception If an error occurs
41
	 */
42
	public function get( string $name ) : \Aimeos\Base\Mail\Iface
43
	{
44
        return new \Aimeos\Base\Mail\Typo3( $this->closure );
45
	}
46
}
47