Completed
Push — master ( 7a069b...4da1f4 )
by Paweł
11s
created

RequiredDataProcessor::processTheme()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 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 2017 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 2017 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\CoreBundle\Theme\Processor;
18
19
use SWP\Bundle\ContentBundle\Service\RouteServiceInterface;
20
use SWP\Bundle\CoreBundle\Theme\Generator\GeneratorInterface;
21
use SWP\Bundle\CoreBundle\Theme\Model\ThemeInterface;
22
23
class RequiredDataProcessor implements RequiredDataProcessorInterface
24
{
25
    /**
26
     * @var RouteServiceInterface
27
     */
28
    protected $themeRoutesGenerator;
29
30
    /**
31
     * @var GeneratorInterface
32
     */
33
    protected $themeMenusGenerator;
34
35
    /**
36
     * @var GeneratorInterface
37
     */
38
    protected $themeContainersGenerator;
39
40
    /**
41
     * @var GeneratorInterface
42
     */
43
    protected $themeWidgetsGenerator;
44
45
    /**
46
     * @var GeneratorInterface
47
     */
48
    protected $themeContentListsGenerator;
49
50
    /**
51
     * RequiredDataProcessor constructor.
52
     *
53
     * @param GeneratorInterface $themeRoutesGenerator
54
     * @param GeneratorInterface $themeMenusGenerator
55
     * @param GeneratorInterface $themeContainersGenerator
56
     * @param GeneratorInterface $themeWidgetsGenerator
57
     * @param GeneratorInterface $themeContentListsGenerator
58
     */
59
    public function __construct(GeneratorInterface $themeRoutesGenerator, GeneratorInterface $themeMenusGenerator, GeneratorInterface $themeContainersGenerator, GeneratorInterface $themeWidgetsGenerator, GeneratorInterface $themeContentListsGenerator)
60
    {
61
        $this->themeRoutesGenerator = $themeRoutesGenerator;
0 ignored issues
show
Documentation Bug introduced by
It seems like $themeRoutesGenerator of type object<SWP\Bundle\CoreBu...tor\GeneratorInterface> is incompatible with the declared type object<SWP\Bundle\Conten...\RouteServiceInterface> of property $themeRoutesGenerator.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
62
        $this->themeMenusGenerator = $themeMenusGenerator;
63
        $this->themeContainersGenerator = $themeContainersGenerator;
64
        $this->themeWidgetsGenerator = $themeWidgetsGenerator;
65
        $this->themeContentListsGenerator = $themeContentListsGenerator;
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public function processTheme(ThemeInterface $theme): void
72
    {
73
        $this->themeRoutesGenerator->generate($theme->getRoutes());
0 ignored issues
show
Bug introduced by
The method generate() does not seem to exist on object<SWP\Bundle\Conten...\RouteServiceInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
74
        $this->themeMenusGenerator->generate($theme->getMenus());
75
        $this->themeContainersGenerator->generate($theme->getContainers());
76
        $this->themeContentListsGenerator->generate($theme->getContentLists());
77
        $this->themeWidgetsGenerator->generate($theme->getWidgets());
78
    }
79
}
80