Completed
Push — master ( 452bc2...a021a5 )
by Kirill
07:56 queued 05:38
created
src/Chrl/AppBundle/Command/DeployCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         /** @var Game $game */
38 38
         foreach ($games as $game) {
39
-            if($input->getOption('success')) {
39
+            if ($input->getOption('success')) {
40 40
                 $tgApi->sendMessage($game->chatId, 'Bot is back online! The game continues...');
41 41
             } else {
42 42
                 $tgApi->sendMessage($game->chatId, 'Bot rebooting due to deploy, sorry. The game will continue once bot boots again.');
Please login to merge, or discard this patch.
src/Chrl/AppBundle/Service/GameService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,'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, '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;
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
 		$game->lastQuestion = $question->getId();
195 195
 		$game->lastQuestionTime = new \DateTime('now');
196 196
 		$game->incorrectTries = 0;
197
-		$game->hint = str_repeat('*',mb_strlen($question->a1,'UTF-8'));
197
+		$game->hint = str_repeat('*', mb_strlen($question->a1, 'UTF-8'));
198 198
 
199 199
 		$this->em->persist($game);
200 200
 		$this->em->persist($question);
201 201
 		$this->em->flush();
202 202
 
203
-        $this->botApi->sendMessage($game->chatId, '*[question]* '.$question->text.' _('.mb_strlen($question->a1,'UTF-8').' letters)_', 'markdown');
203
+        $this->botApi->sendMessage($game->chatId, '*[question]* '.$question->text.' _('.mb_strlen($question->a1, 'UTF-8').' letters)_', 'markdown');
204 204
     }
205 205
 
206 206
     /**
Please login to merge, or discard this patch.