1 | <?php |
||
21 | class GameResultHandler implements MessageEventHandler, LoggerAwareInterface |
||
22 | { |
||
23 | use LoggerAwareTrait; |
||
24 | |||
25 | /** |
||
26 | * @var MiniGameUserFinder |
||
27 | */ |
||
28 | private $userFinder; |
||
29 | |||
30 | /** |
||
31 | * @var ContextUserFinder |
||
32 | */ |
||
33 | private $contextUserFinder; |
||
34 | |||
35 | /** |
||
36 | * @var MessageFinder |
||
37 | */ |
||
38 | private $messageFinder; |
||
39 | |||
40 | /** |
||
41 | * @var MessageFactory |
||
42 | */ |
||
43 | private $messageFactory; |
||
44 | |||
45 | /** |
||
46 | * @var MessageSender |
||
47 | */ |
||
48 | private $messageSender; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * @param MiniGameUserFinder $userFinder |
||
54 | * @param ContextUserFinder $contextUserFinder |
||
55 | * @param MessageFinder $messageFinder |
||
56 | * @param MessageFactory $messageFactory |
||
57 | * @param MessageSender $messageSender |
||
58 | */ |
||
59 | 18 | public function __construct( |
|
73 | |||
74 | /** |
||
75 | * Handle an event. |
||
76 | * |
||
77 | * @param EventInterface $event |
||
78 | * @param Context $context |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | 18 | public function handle(EventInterface $event, Context $context = null) |
|
95 | |||
96 | /** |
||
97 | * @param GameResult $gameResult |
||
98 | * @param ApplicationUser[] $users |
||
99 | * @param mixed $messageContext |
||
100 | * @return void |
||
101 | */ |
||
102 | 12 | private function sendMessage(GameResult $gameResult, array $users = [], $messageContext = null) |
|
113 | |||
114 | /** |
||
115 | * @param Context $context |
||
116 | * @return mixed |
||
117 | */ |
||
118 | 15 | private function getMessageContext(Context $context = null) |
|
127 | |||
128 | /** |
||
129 | * @param PlayerId $playerId |
||
130 | * @param mixed $contextMessage |
||
131 | * @return ApplicationUser |
||
132 | */ |
||
133 | 12 | private function getUser(PlayerId $playerId = null, $contextMessage = null) |
|
151 | |||
152 | /** |
||
153 | * @param PlayerId $id |
||
154 | * @return ApplicationUser |
||
155 | */ |
||
156 | 12 | private function getUserByPlayerId(PlayerId $id = null) |
|
160 | |||
161 | /** |
||
162 | * @param mixed $contextMessage |
||
163 | * @return ApplicationUser |
||
164 | */ |
||
165 | 9 | private function getUserByContext($contextMessage = null) |
|
174 | |||
175 | /** |
||
176 | * @param GameResult $event |
||
177 | * @param mixed $messageContext |
||
178 | * |
||
179 | * @return ApplicationUser[] |
||
180 | */ |
||
181 | 15 | private function getUsersList(GameResult $event, $messageContext) |
|
189 | } |
||
190 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: