@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if (mb_strtoupper($question->a1, 'UTF-8') == mb_strtoupper($message['text'], 'UTF-8')) { |
122 | 122 | // Correct answer! |
123 | 123 | |
124 | - $user->setPoints($user->getPoints()+$question->price); |
|
124 | + $user->setPoints($user->getPoints() + $question->price); |
|
125 | 125 | $this->em->persist($user); |
126 | 126 | |
127 | 127 | $this->botApi->sendMessage( |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | $game->incorrectTries++; |
143 | 143 | $hint = $game->hint; |
144 | 144 | |
145 | - if (mb_substr_count($hint,'*','UTF-8') < mb_strlen($hint,'UTF-8')/2) { |
|
145 | + if (mb_substr_count($hint, '*', 'UTF-8') < mb_strlen($hint, 'UTF-8') / 2) { |
|
146 | 146 | //tell hint |
147 | 147 | |
148 | - $tPos = rand(0,mb_strlen($question->a1,'UTF-8')); |
|
148 | + $tPos = rand(0, mb_strlen($question->a1, 'UTF-8')); |
|
149 | 149 | |
150 | - while($game->hint == $hint) { |
|
151 | - $hint = mb_substr($hint,0,$tPos-1,'UTF-8'). |
|
152 | - mb_substr($question->a1,$tPos,1,'UTF-8'). |
|
153 | - mb_substr($hint,$tPos+1,200,'UTF-8'); |
|
150 | + while ($game->hint == $hint) { |
|
151 | + $hint = mb_substr($hint, 0, $tPos - 1, 'UTF-8'). |
|
152 | + mb_substr($question->a1, $tPos, 1, 'UTF-8'). |
|
153 | + mb_substr($hint, $tPos + 1, 200, 'UTF-8'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $game->hint = $hint; |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | $game->lastQuestion = $question->getId(); |
194 | 194 | $game->lastQuestionTime = new \DateTime('now'); |
195 | 195 | $game->incorrectTries = 0; |
196 | - $game->hint = str_repeat('*',mb_strlen($question->a1,'UTF-8')); |
|
196 | + $game->hint = str_repeat('*', mb_strlen($question->a1, 'UTF-8')); |
|
197 | 197 | |
198 | 198 | $this->em->persist($game); |
199 | 199 | $this->em->persist($question); |
200 | 200 | $this->em->flush(); |
201 | 201 | |
202 | - $this->botApi->sendMessage($game->chatId, '*[question]* '.$question->text.' _('.mb_strlen($question->a1,'UTF-8').' letters)_', 'markdown'); |
|
202 | + $this->botApi->sendMessage($game->chatId, '*[question]* '.$question->text.' _('.mb_strlen($question->a1, 'UTF-8').' letters)_', 'markdown'); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |