Completed
Pull Request — 1.4 (#641)
by Rafał
09:13
created

MediaManager::getMediaPublicUrl()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
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\CoreBundle\Manager;
16
17
use SWP\Bundle\ContentBundle\Manager\MediaManager as BaseMediaManager;
18
use SWP\Component\MultiTenancy\Context\TenantContextInterface;
19
20 View Code Duplication
class MediaManager extends BaseMediaManager
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    /**
23
     * @var TenantContextInterface
24
     */
25
    protected $tenantContext;
26
27
    /**
28
     * @param TenantContextInterface $tenantContext
29
     */
30
    public function setTenantContext(TenantContextInterface $tenantContext)
31
    {
32
        $this->tenantContext = $tenantContext;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    protected function getMediaBasePath(): string
39
    {
40
        $tenant = $this->tenantContext->getTenant();
41
        $pathElements = ['swp', $tenant->getOrganization()->getCode(), 'media'];
42
43
        return implode('/', $pathElements);
44
    }
45
}
46