Completed
Push — master ( 3d485f...407dff )
by Paweł
66:49
created

RevisionAwareContainerRenderer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderOpenTag() 0 15 2
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\CoreBundle\Container;
16
17
use SWP\Bundle\TemplatesSystemBundle\Container\ContainerRenderer;
18
use SWP\Component\Revision\RevisionAwareInterface;
19
20
class RevisionAwareContainerRenderer extends ContainerRenderer
21
{
22
    /**
23
     * Render open tag for container.
24
     *
25
     * @return string
26
     */
27
    public function renderOpenTag()
28
    {
29
        $id = $this->containerEntity->getId();
30
        if ($this->containerEntity instanceof RevisionAwareInterface) {
31
            $id = $this->containerEntity->getUuid();
32
        }
33
34
        return $this->renderer->render('open_tag', [
35
            'id' => $id,
36
            'class' => $this->containerEntity->getCssClass(),
37
            'styles' => $this->containerEntity->getStyles(),
38
            'visible' => $this->containerEntity->getVisible(),
39
            'data' => $this->containerEntity->getData(),
40
        ]);
41
    }
42
}
43