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

MessageProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 10
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