@@ -42,9 +42,11 @@ |
||
42 | 42 | |
43 | 43 | $em = $this->doctrine->getManager(); |
44 | 44 | $user = $em->getRepository('AppBundle:User')->findBy(['email' => $email]); |
45 | - if (!$user) |
|
46 | - $user = new User(); |
|
47 | - else $user = $user[0]; |
|
45 | + if (!$user) { |
|
46 | + $user = new User(); |
|
47 | + } else { |
|
48 | + $user = $user[0]; |
|
49 | + } |
|
48 | 50 | |
49 | 51 | $pass = $this->userPasswordEncoder->encodePassword($user, $password); |
50 | 52 | $user->setEmail($email); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 29.01.16 |
|
6 | - * Time: 17:07 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 29.01.16 |
|
6 | + * Time: 17:07 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Services; |
10 | 10 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 23.02.16 |
|
6 | - * Time: 13:03 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 23.02.16 |
|
6 | + * Time: 13:03 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Services; |
10 | 10 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $lastName = $input->getArgument('lastName'); |
42 | 42 | |
43 | 43 | $this->getContainer()->get('app.admin.creator') |
44 | - ->create($email, $password, $firstName, $lastName); |
|
44 | + ->create($email, $password, $firstName, $lastName); |
|
45 | 45 | |
46 | 46 | $output->writeln(sprintf('User <comment>%s</comment> was created/updated', $firstName.' '.$lastName)); |
47 | 47 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 24.02.16 |
|
6 | - * Time: 11:21 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 24.02.16 |
|
6 | + * Time: 11:21 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\EventListener; |
10 | 10 |
@@ -64,8 +64,7 @@ |
||
64 | 64 | $result = $sumTrueCorrect != 0 ? 1 / $sumTrueCorrect / 2 : 0; |
65 | 65 | } elseif ($countFalseAnswers > 1) { |
66 | 66 | $result = 0; |
67 | - } |
|
68 | - else { |
|
67 | + } else { |
|
69 | 68 | $result = $sumTrueCorrect != 0 ? 1 / $sumTrueCorrect : 0; |
70 | 69 | } |
71 | 70 | //third type question |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 09.03.16 |
|
6 | - * Time: 19:01 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 09.03.16 |
|
6 | + * Time: 19:01 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Services; |
10 | 10 |
@@ -56,8 +56,9 @@ discard block |
||
56 | 56 | return $this->generateOutput('error', 403, 'You do not have access to this module'); |
57 | 57 | } |
58 | 58 | |
59 | - if ($moduleUser->getAttempts() == $moduleUser->getModule()->getAttempts()) |
|
60 | - return $this->generateOutput('error', 403, 'Your attempts are exhausted'); |
|
59 | + if ($moduleUser->getAttempts() == $moduleUser->getModule()->getAttempts()) { |
|
60 | + return $this->generateOutput('error', 403, 'Your attempts are exhausted'); |
|
61 | + } |
|
61 | 62 | |
62 | 63 | $lastPass = $moduleUser->getPassModules()->last(); |
63 | 64 | |
@@ -68,8 +69,9 @@ discard block |
||
68 | 69 | |
69 | 70 | $time_residue = $this->checkDatePass($lastPass); |
70 | 71 | |
71 | - if (!$time_residue) |
|
72 | - $this->identPass($idModule); |
|
72 | + if (!$time_residue) { |
|
73 | + $this->identPass($idModule); |
|
74 | + } |
|
73 | 75 | |
74 | 76 | return $this->generateOutput('redirect_to_pass', 301, $lastPass->getId()); |
75 | 77 | } |
@@ -137,8 +139,9 @@ discard block |
||
137 | 139 | $firstQuestionForPass = $this->doctrine->getRepository('AppBundle:Question') |
138 | 140 | ->getFirstQuestionForPass($passModule->getId()); |
139 | 141 | |
140 | - if(null === $firstQuestionForPass) |
|
141 | - return $this->generateOutput('error', 500, 'This module does not have any questions ;('); |
|
142 | + if(null === $firstQuestionForPass) { |
|
143 | + return $this->generateOutput('error', 500, 'This module does not have any questions ;('); |
|
144 | + } |
|
142 | 145 | |
143 | 146 | $passModule->setCurrentQuestion($firstQuestionForPass); |
144 | 147 | $this->doctrine->getEntityManager()->flush(); |
@@ -150,8 +153,9 @@ discard block |
||
150 | 153 | |
151 | 154 | $time_residue = $this->checkDatePass($passModule); |
152 | 155 | |
153 | - if (!$time_residue) |
|
154 | - return $this->generateOutput('error', 403, 'This pass is overdue ;('); |
|
156 | + if (!$time_residue) { |
|
157 | + return $this->generateOutput('error', 403, 'This pass is overdue ;('); |
|
158 | + } |
|
155 | 159 | |
156 | 160 | |
157 | 161 | $currentQuestion = $passModule->getCurrentQuestion(); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 18.03.16 |
|
6 | - * Time: 18:33 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 18.03.16 |
|
6 | + * Time: 18:33 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Tests\Controller\Admin; |
10 | 10 |