Completed
Push — master ( 1e6b4e...d692a8 )
by Rafał
14:51
created

MultiTenancyExtension::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Component.
5
 *
6
 * Copyright 2016 Sourcefabric z.u. 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\MultiTenancyBundle\Twig;
16
17
use SWP\Component\MultiTenancy\Context\TenantContextInterface;
18
19
class MultiTenancyExtension extends \Twig_Extension
20
{
21
    /**
22
     * @var TenantContextInterface
23
     */
24
    protected $tenantContext;
25
26
    /**
27
     * @param TenantContextInterface $tenantContext
28
     */
29
    public function __construct(TenantContextInterface $tenantContext)
30
    {
31
        $this->tenantContext = $tenantContext;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getGlobals()
38
    {
39
        return [
40
            'organization' => $this->tenantContext->getTenant(),
41
        ];
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getName()
48
    {
49
        return 'swp_multi_tenancy';
50
    }
51
}
52