1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Stu\Module\Game\Lib\View\Provider\Message; |
6
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
8
|
|
|
use request; |
9
|
|
|
use Stu\Component\Game\GameEnum; |
|
|
|
|
10
|
|
|
use Stu\Lib\Component\ComponentRegistrationInterface; |
11
|
|
|
use Stu\Module\Control\GameControllerInterface; |
12
|
|
|
use Stu\Module\Game\Component\GameComponentEnum; |
13
|
|
|
use Stu\Module\Game\Lib\View\Provider\ViewComponentProviderInterface; |
14
|
|
|
use Stu\Module\Message\Lib\PrivateMessageFolderItem; |
15
|
|
|
use Stu\Module\Message\Lib\PrivateMessageUiFactoryInterface; |
16
|
|
|
use Stu\Orm\Entity\PrivateMessageFolderInterface; |
17
|
|
|
use Stu\Orm\Repository\PrivateMessageFolderRepositoryInterface; |
18
|
|
|
|
19
|
|
|
final class MessageProvider implements ViewComponentProviderInterface |
20
|
|
|
{ |
21
|
1 |
|
public function __construct( |
22
|
|
|
private PrivateMessageFolderRepositoryInterface $privateMessageFolderRepository, |
23
|
|
|
private ComponentRegistrationInterface $componentRegistration, |
24
|
|
|
private ClassicStyleProvider $ClassicStyleProvider, |
|
|
|
|
25
|
|
|
private MessengerStyleProvider $messengerStyleProvider, |
26
|
|
|
private PrivateMessageUiFactoryInterface $privateMessageUiFactory |
27
|
1 |
|
) {} |
28
|
|
|
|
29
|
1 |
|
#[Override] |
30
|
|
|
public function setTemplateVariables(GameControllerInterface $game): void |
31
|
|
|
{ |
32
|
1 |
|
if (!request::has('pmcat') && $game->getUser()->isInboxMessengerStyle()) { |
33
|
|
|
$this->messengerStyleProvider->setTemplateVariables($game); |
34
|
|
|
} else { |
35
|
1 |
|
$this->ClassicStyleProvider->setTemplateVariables($game); |
36
|
|
|
} |
37
|
|
|
|
38
|
1 |
|
$game->setTemplateVar( |
39
|
1 |
|
'PM_CATEGORIES', |
40
|
1 |
|
array_map( |
41
|
1 |
|
fn(PrivateMessageFolderInterface $folder): PrivateMessageFolderItem => |
42
|
1 |
|
$this->privateMessageUiFactory->createPrivateMessageFolderItem($folder), |
43
|
1 |
|
$this->privateMessageFolderRepository->getOrderedByUser($game->getUser()) |
44
|
1 |
|
) |
45
|
1 |
|
); |
46
|
|
|
|
47
|
1 |
|
$this->componentRegistration->addComponentUpdate(GameComponentEnum::PM); |
48
|
1 |
|
$game->addExecuteJS("initTranslations();", GameEnum::JS_EXECUTION_AFTER_RENDER); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths