1 | <?php |
||
23 | class GameResultHandler implements MessageEventHandler, LoggerAwareInterface |
||
24 | { |
||
25 | use LoggerAwareTrait; |
||
26 | |||
27 | /** |
||
28 | * @var MiniGameUserFinder |
||
29 | */ |
||
30 | private $userFinder; |
||
31 | |||
32 | /** |
||
33 | * @var ContextUserFinder |
||
34 | */ |
||
35 | private $contextUserFinder; |
||
36 | |||
37 | /** |
||
38 | * @var MessageFinder |
||
39 | */ |
||
40 | private $messageFinder; |
||
41 | |||
42 | /** |
||
43 | * @var MessageFactory |
||
44 | */ |
||
45 | private $messageFactory; |
||
46 | |||
47 | /** |
||
48 | * @var MessageSender |
||
49 | */ |
||
50 | private $messageSender; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param MiniGameUserFinder $userFinder |
||
56 | * @param ContextUserFinder $contextUserFinder |
||
57 | * @param MessageFinder $messageFinder |
||
58 | * @param MessageFactory $messageFactory |
||
59 | * @param MessageSender $messageSender |
||
60 | */ |
||
61 | 18 | public function __construct( |
|
75 | |||
76 | /** |
||
77 | * Handle an event. |
||
78 | * |
||
79 | * @param EventInterface $event |
||
80 | * @param Context $context |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | 18 | public function handle(EventInterface $event, Context $context = null) |
|
97 | |||
98 | /** |
||
99 | * @param GameResult $gameResult |
||
100 | * @param ApplicationUser[] $users |
||
101 | * @param mixed $messageContext |
||
102 | * @return void |
||
103 | */ |
||
104 | 12 | private function sendMessage(GameResult $gameResult, array $users = [], $messageContext = null) |
|
115 | |||
116 | /** |
||
117 | * @param Context $context |
||
118 | * @return mixed |
||
119 | */ |
||
120 | 15 | private function getMessageContext(Context $context = null) |
|
129 | |||
130 | /** |
||
131 | * @param PlayerId $playerId |
||
132 | * @param mixed $contextMessage |
||
133 | * @return ApplicationUser |
||
134 | */ |
||
135 | 12 | private function getUser(PlayerId $playerId = null, $contextMessage = null) |
|
153 | |||
154 | /** |
||
155 | * @param PlayerId $id |
||
156 | * @return ApplicationUser |
||
157 | */ |
||
158 | 12 | private function getUserByPlayerId(PlayerId $id = null) |
|
162 | |||
163 | /** |
||
164 | * @param mixed $contextMessage |
||
165 | * @return ApplicationUser |
||
166 | */ |
||
167 | 9 | private function getUserByContext($contextMessage = null) |
|
176 | |||
177 | /** |
||
178 | * @param GameResult $event |
||
179 | * @param mixed $messageContext |
||
180 | * |
||
181 | * @return MiniGameApplicationUser[] |
||
182 | */ |
||
183 | 15 | private function getUsersList(GameResult $event, $messageContext) |
|
191 | } |
||
192 |
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: