|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Game\Lib\View\Provider\Message; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use Stu\Module\Message\Lib\PrivateMessageListItem; |
|
9
|
|
|
use Stu\Orm\Entity\PrivateMessageInterface; |
|
10
|
|
|
use Stu\Orm\Entity\UserInterface; |
|
11
|
|
|
use Stu\Orm\Repository\ContactRepositoryInterface; |
|
12
|
|
|
use Stu\Orm\Repository\PrivateMessageRepositoryInterface; |
|
13
|
|
|
|
|
14
|
|
|
final class Conversation extends PrivateMessageListItem |
|
15
|
|
|
{ |
|
16
|
1 |
|
public function __construct( |
|
17
|
|
|
private PrivateMessageInterface $message, |
|
18
|
|
|
private int $unreadPmCount, |
|
19
|
|
|
private string $dateString, |
|
20
|
|
|
UserInterface $currentUser, |
|
21
|
|
|
PrivateMessageRepositoryInterface $privateMessageRepository, |
|
22
|
|
|
ContactRepositoryInterface $contactRepository |
|
23
|
|
|
) { |
|
24
|
1 |
|
parent::__construct( |
|
25
|
1 |
|
$privateMessageRepository, |
|
26
|
1 |
|
$contactRepository, |
|
27
|
1 |
|
$message, |
|
28
|
1 |
|
$currentUser |
|
29
|
1 |
|
); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
1 |
|
#[Override] |
|
33
|
|
|
public function isMarkableAsNew(): bool |
|
34
|
|
|
{ |
|
35
|
1 |
|
return $this->message->getNew(); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
1 |
|
public function getUnreadMessageCount(): int |
|
39
|
|
|
{ |
|
40
|
1 |
|
return $this->unreadPmCount; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
1 |
|
public function getLastHeadline(): string |
|
44
|
|
|
{ |
|
45
|
1 |
|
return sprintf( |
|
46
|
1 |
|
'%s%s', |
|
47
|
1 |
|
$this->message->getInboxPm() === null ? sprintf( |
|
48
|
1 |
|
'%s: ', |
|
49
|
1 |
|
$this->getOtherUser()->getName() |
|
50
|
1 |
|
) : '', |
|
51
|
1 |
|
substr($this->message->getText(), 0, 200) |
|
52
|
1 |
|
); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
1 |
|
public function getOtherUser(): UserInterface |
|
56
|
|
|
{ |
|
57
|
1 |
|
return $this->message->getSender(); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
1 |
|
public function getDateString(): string |
|
61
|
|
|
{ |
|
62
|
1 |
|
return $this->dateString; |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
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