Typo3   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A render() 0 8 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2025
6
 * @package MW
7
 * @subpackage View
8
 */
9
10
11
namespace Aimeos\Base\View\Engine;
12
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
13
14
15
/**
16
 * TYPO3 view engine implementation
17
 *
18
 * @package MW
19
 * @subpackage View
20
 */
21
class Typo3 implements Iface
22
{
23
	private $view;
24
25
26
	/**
27
	 * Initializes the view object
28
	 *
29
	 * @param \TYPO3Fluid\Fluid\View\ViewInterface $view TYPO3 view
30
	 */
31
	public function __construct( \TYPO3Fluid\Fluid\View\ViewInterface $view )
32
	{
33
		$this->view = $view;
34
	}
35
36
37
	/**
38
	 * Renders the output based on the given template file name and the key/value pairs
39
	 *
40
	 * @param \Aimeos\Base\View\Iface $view View object
41
	 * @param string $filename File name of the view template
42
	 * @param array $values Associative list of key/value pairs
43
	 * @return string Output generated by the template
44
	 * @throws \Aimeos\Base\View\Exception If the template isn't found
45
	 */
46
	public function render( \Aimeos\Base\View\Iface $view, string $filename, array $values ) : string
47
	{
48
		$fluid = clone $this->view;
49
		$fluid->setTemplatePathAndFilename( $filename );
0 ignored issues
show
Bug introduced by
The method setTemplatePathAndFilename() does not exist on TYPO3Fluid\Fluid\View\ViewInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

49
		$fluid->/** @scrutinizer ignore-call */ 
50
          setTemplatePathAndFilename( $filename );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
50
		$fluid->assign( '_aimeos_view', $view );
51
		$fluid->assignMultiple( $values );
52
53
		return $fluid->render();
54
	}
55
}
56