Completed
Push — master ( e0ce4d...f8b64c )
by Kirill
02:15
created
src/Chrl/AppBundle/Service/GameService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                     : ''
78 78
                 )
79 79
             );
80
-            $user->setAlias(isset($message['from']['username'])? $message['from']['username']:'username');
80
+            $user->setAlias(isset($message['from']['username']) ? $message['from']['username'] : 'username');
81 81
             $user->setTgId($message['from']['id']);
82 82
             $user->setGame($this->findGame($message));
83 83
             $user->setChatId($message['chat']['id']);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             if (mb_strtoupper($question->a1, 'UTF-8') == mb_strtoupper($message['text'], 'UTF-8')) {
123 123
                 // Correct answer!
124 124
 
125
-                $user->setPoints($user->getPoints()+$question->price);
125
+                $user->setPoints($user->getPoints() + $question->price);
126 126
                 $this->em->persist($user);
127 127
 
128 128
                 // Log points
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
                 $game->incorrectTries++;
157 157
                 $hint = $game->hint;
158 158
 
159
-                if (mb_substr_count($hint, '*', 'UTF-8') >= mb_strlen($hint, 'UTF-8')/2) {
159
+                if (mb_substr_count($hint, '*', 'UTF-8') >= mb_strlen($hint, 'UTF-8') / 2) {
160 160
                     //tell hint
161 161
 
162
-                    for ($t = 0; $t< mb_strlen($hint); $t++) {
162
+                    for ($t = 0; $t < mb_strlen($hint); $t++) {
163 163
                         if (mb_substr($hint, $t, 1, 'UTF-8') == '*') {
164
-                            if (rand(0, 1)==1) {
164
+                            if (rand(0, 1) == 1) {
165 165
                                 $hint = mb_substr($hint, 0, $t, 'UTF-8')
166 166
                                         .mb_substr($question->a1, $t, 1)
167
-                                        .mb_substr($hint, $t+1);
167
+                                        .mb_substr($hint, $t + 1);
168 168
                                 break;
169 169
                             }
170 170
                         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $this->botApi->sendMessage(
219 219
             $game->chatId,
220 220
             '*[question]* '.
221
-            $question->text.' _('.mb_strlen($question->a1, 'UTF-8'). ' letters)_',
221
+            $question->text.' _('.mb_strlen($question->a1, 'UTF-8').' letters)_',
222 222
             'markdown'
223 223
         );
224 224
     }
Please login to merge, or discard this patch.