1 | <?php |
||
24 | class GameResultHandler implements MessageEventHandler, LoggerAwareInterface |
||
25 | { |
||
26 | use LoggerAwareTrait; |
||
27 | |||
28 | /** |
||
29 | * @var MiniGameUserFinder |
||
30 | */ |
||
31 | private $userFinder; |
||
32 | |||
33 | /** |
||
34 | * @var ContextUserFinder |
||
35 | */ |
||
36 | private $contextUserFinder; |
||
37 | |||
38 | /** |
||
39 | * @var MessageFinder |
||
40 | */ |
||
41 | private $messageFinder; |
||
42 | |||
43 | /** |
||
44 | * @var MessageSender |
||
45 | */ |
||
46 | private $messageSender; |
||
47 | |||
48 | /** |
||
49 | * @var MessageFactory |
||
50 | */ |
||
51 | private $messageFactory; |
||
52 | |||
53 | /** |
||
54 | * Constructor |
||
55 | * |
||
56 | * @param MiniGameUserFinder $userFinder |
||
57 | * @param ContextUserFinder $contextUserFinder |
||
58 | * @param MessageFinder $messageFinder |
||
59 | * @param MessageSender $messageSender |
||
60 | * @param MessageFactory $messageFactory |
||
61 | */ |
||
62 | 18 | public function __construct( |
|
76 | |||
77 | /** |
||
78 | * Handle an event. |
||
79 | * |
||
80 | * @param EventInterface $event |
||
81 | * @param Context $context |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | 18 | public function handle(EventInterface $event, Context $context = null) |
|
102 | |||
103 | /** |
||
104 | * @param GameResult $gameResult |
||
105 | * @param ApplicationUser[] $users |
||
106 | * @param mixed $messageContext |
||
107 | * @return void |
||
108 | */ |
||
109 | 12 | private function sendMessage(GameResult $gameResult, array $users = array(), $messageContext = null) |
|
119 | |||
120 | /** |
||
121 | * @param Context $context |
||
122 | * @return mixed |
||
123 | */ |
||
124 | 15 | private function getMessageContext(Context $context = null) |
|
133 | |||
134 | /** |
||
135 | * @param PlayerId $playerId |
||
136 | * @param mixed $contextMessage |
||
137 | * @return ApplicationUser |
||
138 | */ |
||
139 | 12 | private function getUser(PlayerId $playerId = null, $contextMessage = null) |
|
157 | |||
158 | /** |
||
159 | * @param PlayerId $id |
||
160 | * @return ApplicationUser |
||
161 | */ |
||
162 | 12 | private function getUserByPlayerId(PlayerId $id = null) |
|
166 | |||
167 | /** |
||
168 | * @param mixed $contextMessage |
||
169 | * @return ApplicationUser |
||
170 | */ |
||
171 | 9 | private function getUserByContext($contextMessage = null) |
|
180 | } |
||
181 |
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: