Passed
Push — dev ( 4c76dc...4abd48 )
by Janko
09:59
created

MessageProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 87.5%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 19
ccs 7
cts 8
cp 0.875
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setTemplateVariables() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Game\Lib\View\Provider\Message;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Stu\Component\Game\GameEnum;
0 ignored issues
show
Bug introduced by
The type Stu\Component\Game\GameEnum was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Stu\Lib\Component\ComponentRegistrationInterface;
10
use Stu\Module\Control\GameControllerInterface;
11
use Stu\Module\Game\Component\GameComponentEnum;
12
use Stu\Module\Game\Lib\View\Provider\ViewComponentProviderInterface;
13
14
final class MessageProvider implements ViewComponentProviderInterface
15
{
16 1
    public function __construct(
17
        private ComponentRegistrationInterface $componentRegistration,
18
        private ClassicStyleProvider $ClassicStyleProvider,
0 ignored issues
show
Bug introduced by
The type Stu\Module\Game\Lib\View...ge\ClassicStyleProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
        private MessengerStyleProvider $messengerStyleProvider
20 1
    ) {}
21
22 1
    #[Override]
23
    public function setTemplateVariables(GameControllerInterface $game): void
24
    {
25 1
        if ($game->getUser()->isInboxMessengerStyle()) {
26
            $this->messengerStyleProvider->setTemplateVariables($game);
27
        } else {
28 1
            $this->ClassicStyleProvider->setTemplateVariables($game);
29
        }
30
31 1
        $this->componentRegistration->addComponentUpdate(GameComponentEnum::PM);
32 1
        $game->addExecuteJS("initTranslations();", GameEnum::JS_EXECUTION_AFTER_RENDER);
33
    }
34
}
35