Completed
Pull Request — 1.3 (#467)
by Rafał
08:19
created

TemplateWidgetHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Core Bundle.
7
 *
8
 * Copyright 2018 Sourcefabric z.ú. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2018 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\CoreBundle\Widget;
18
19
use SWP\Bundle\TemplatesSystemBundle\Widget\TemplatingWidgetHandler;
20
21
class TemplateWidgetHandler extends TemplatingWidgetHandler
22
{
23
    public const TEMPLATE_NAME = 'template_name';
24
25
    protected static $expectedParameters = [
26
         self::TEMPLATE_NAME => [
27
            'type' => 'string',
28
        ],
29
    ];
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function render()
35
    {
36
        return $this->renderTemplate($this->getModelParameter(self::TEMPLATE_NAME));
37
    }
38
}
39