TestThemeManager::getProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Tests\Fixtures\Manager;
13
14
use Psr\Log\LoggerInterface;
15
use Twig\Environment;
16
use WBW\Bundle\CoreBundle\Manager\AbstractThemeManager;
17
use WBW\Library\Symfony\Manager\ManagerInterface;
18
use WBW\Library\Symfony\Provider\ThemeProviderInterface;
19
20
/**
21
 * Test theme manager.
22
 *
23
 * @author webeweb <https://github.com/webeweb>
24
 * @package WBW\Bundle\CoreBundle\Tests\Fixtures\Manager
25
 */
26
class TestThemeManager extends AbstractThemeManager {
27
28
    /**
29
     * {@inheritDoc}.
30
     */
31
    public function __construct(LoggerInterface $logger, Environment $twigEnvironment) {
32
        parent::__construct($logger, $twigEnvironment);
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function getProvider(string $name): ?ThemeProviderInterface {
39
        return parent::getProvider($name);
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45
    protected function initIndex(): array {
46
47
        return [
48
            ThemeProviderInterface::class => null,
49
        ];
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55
    public function setProvider(string $name, ?ThemeProviderInterface $provider): ManagerInterface {
56
        return parent::setProvider($name, $provider);
0 ignored issues
show
Bug introduced by
It seems like $provider can also be of type null; however, parameter $provider of WBW\Bundle\CoreBundle\Ma...eManager::setProvider() does only seem to accept WBW\Library\Symfony\Prov...\ThemeProviderInterface, maybe add an additional type check? ( Ignorable by Annotation )

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

56
        return parent::setProvider($name, /** @scrutinizer ignore-type */ $provider);
Loading history...
57
    }
58
}
59