Passed
Push — master ( d5a28b...d12ca0 )
by
unknown
17:01
created

ModuleTemplateFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A create() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace TYPO3\CMS\Backend\Template;
19
20
use Psr\Http\Message\ServerRequestInterface;
21
use TYPO3\CMS\Core\Imaging\IconFactory;
22
use TYPO3\CMS\Core\Messaging\FlashMessageService;
23
use TYPO3\CMS\Core\Page\PageRenderer;
24
25
/**
26
 * A factory class taking care of building ModuleTemplate objects
27
 */
28
class ModuleTemplateFactory
29
{
30
    protected PageRenderer $pageRenderer;
31
    protected IconFactory $iconFactory;
32
    protected FlashMessageService $flashMessageService;
33
34
    public function __construct(
35
        PageRenderer $pageRenderer,
36
        IconFactory $iconFactory,
37
        FlashMessageService $flashMessageService
38
    ) {
39
        $this->pageRenderer = $pageRenderer;
40
        $this->iconFactory = $iconFactory;
41
        $this->flashMessageService = $flashMessageService;
42
    }
43
44
    public function create(ServerRequestInterface $request): ModuleTemplate
45
    {
46
        return new ModuleTemplate(
47
            $this->pageRenderer,
48
            $this->iconFactory,
49
            $this->flashMessageService,
50
            $request
51
        );
52
    }
53
}
54