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 MessageSender |
||
44 | */ |
||
45 | private $messageSender; |
||
46 | |||
47 | /** |
||
48 | * @var MiniGameMessageExtractor |
||
49 | */ |
||
50 | private $extractor; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param MiniGameUserFinder $userFinder |
||
56 | * @param ContextUserFinder $contextUserFinder |
||
57 | * @param MessageFinder $messageFinder |
||
58 | * @param MessageSender $messageSender |
||
59 | * @param MiniGameMessageExtractor $extractor |
||
60 | 18 | */ |
|
61 | public function __construct( |
||
75 | |||
76 | /** |
||
77 | * Handle an event. |
||
78 | * |
||
79 | * @param EventInterface $event |
||
80 | * @param Context $context |
||
81 | * |
||
82 | * @return void |
||
83 | 18 | */ |
|
84 | public function handle(EventInterface $event, Context $context = null) |
||
101 | 2 | ||
102 | 2 | /** |
|
103 | 12 | * @param GameResult $gameResult |
|
104 | 9 | * @param ApplicationUser[] $users |
|
105 | 9 | * @param mixed $messageContext |
|
106 | 6 | * @return void |
|
107 | 9 | */ |
|
108 | 6 | private function sendMessage(GameResult $gameResult, array $users = array(), $messageContext = null) |
|
125 | |||
126 | /** |
||
127 | 9 | * @param ApplicationUser[] $users |
|
128 | 9 | * @return ApplicationUser[] |
|
129 | 9 | */ |
|
130 | private static function filterUsers(array $users) |
||
138 | 9 | ||
139 | /** |
||
140 | * @param ApplicationUser[] $users |
||
141 | 6 | * @return string |
|
142 | 6 | */ |
|
143 | private static function getLanguage(array $users) |
||
147 | |||
148 | /** |
||
149 | * @param Context $context |
||
150 | 12 | * @return mixed |
|
151 | */ |
||
152 | private function getMessageContext(Context $context = null) |
||
161 | |||
162 | 3 | /** |
|
163 | * @param PlayerId $playerId |
||
164 | 2 | * @param mixed $contextMessage |
|
165 | * @return ApplicationUser |
||
166 | 6 | */ |
|
167 | private function getUser(PlayerId $playerId = null, $contextMessage = null) |
||
185 | 3 | ||
186 | 3 | /** |
|
187 | * @param PlayerId $id |
||
188 | * @return ApplicationUser |
||
189 | 6 | */ |
|
190 | private function getUserByPlayerId(PlayerId $id = null) |
||
194 | |||
195 | /** |
||
196 | * @param mixed $contextMessage |
||
197 | * @return ApplicationUser |
||
198 | */ |
||
199 | private function getUserByContext($contextMessage = null) |
||
208 | } |
||
209 |
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: