@@ -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 | |
@@ -72,24 +72,24 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function checkUserHash($hash, $email) |
| 74 | 74 | { |
| 75 | - $em = $this->getDoctrine()->getManager(); |
|
| 75 | + $em = $this->getDoctrine()->getManager(); |
|
| 76 | 76 | |
| 77 | - $user = $em->getRepository('AppBundle:User') |
|
| 78 | - ->findOneBy(array('email' => $email, 'hash' => $hash)); |
|
| 77 | + $user = $em->getRepository('AppBundle:User') |
|
| 78 | + ->findOneBy(array('email' => $email, 'hash' => $hash)); |
|
| 79 | 79 | |
| 80 | - if ($user) { |
|
| 80 | + if ($user) { |
|
| 81 | 81 | |
| 82 | - $user->setIsReg(true); |
|
| 83 | - $user->setHash(null); |
|
| 84 | - $this->addFlash('notice', 'You have successfully passed registration confirmation'); |
|
| 82 | + $user->setIsReg(true); |
|
| 83 | + $user->setHash(null); |
|
| 84 | + $this->addFlash('notice', 'You have successfully passed registration confirmation'); |
|
| 85 | 85 | |
| 86 | - $em->flush(); |
|
| 86 | + $em->flush(); |
|
| 87 | 87 | |
| 88 | - return $this->redirectToRoute('homepage'); |
|
| 89 | - } |
|
| 88 | + return $this->redirectToRoute('homepage'); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - $this->addFlash('notice', 'You haven\'t passed registration confirmation'); |
|
| 91 | + $this->addFlash('notice', 'You haven\'t passed registration confirmation'); |
|
| 92 | 92 | |
| 93 | - return $this->redirectToRoute('homepage'); |
|
| 93 | + return $this->redirectToRoute('homepage'); |
|
| 94 | 94 | } |
| 95 | 95 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: device |
|
| 5 | - * Date: 18.03.16 |
|
| 6 | - * Time: 18:02 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: device |
|
| 5 | + * Date: 18.03.16 |
|
| 6 | + * Time: 18:02 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Tests\Controller\Admin; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: device |
|
| 5 | - * Date: 18.03.16 |
|
| 6 | - * Time: 18:34 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: device |
|
| 5 | + * Date: 18.03.16 |
|
| 6 | + * Time: 18:34 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Tests\Controller\Admin; |
| 10 | 10 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | 'PHP_AUTH_USER' => '[email protected]', |
| 50 | 50 | 'PHP_AUTH_PW' => 'user', |
| 51 | 51 | )); |
| 52 | - $client->request('GET', '/admin/question/show/1'); |
|
| 52 | + $client->request('GET', '/admin/question/show/1'); |
|
| 53 | 53 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -40,8 +40,9 @@ discard block |
||
| 40 | 40 | $data["answer_{$item->getId()}"] ? $countAllChecks++ : null; |
| 41 | 41 | if ($item->getCorrectly() === $data["answer_{$item->getId()}"]) { |
| 42 | 42 | $sumAllCorrect++; |
| 43 | - if ($item->getCorrectly()) |
|
| 44 | - $sumCorrectChecks++; |
|
| 43 | + if ($item->getCorrectly()) { |
|
| 44 | + $sumCorrectChecks++; |
|
| 45 | + } |
|
| 45 | 46 | } else { |
| 46 | 47 | if ($item->getCorrectly() === false) { |
| 47 | 48 | $sumFalseAnswers++; |
@@ -58,8 +59,9 @@ discard block |
||
| 58 | 59 | if ($question->getAllIncorrect() || $data['answer_all_incorrect']) { |
| 59 | 60 | if ($question->getAllIncorrect() === $data['answer_all_incorrect'] && $question->getAllIncorrect() === true && |
| 60 | 61 | $sumAllCorrect == $countOriginalAnswers |
| 61 | - ) |
|
| 62 | - return 1; |
|
| 62 | + ) { |
|
| 63 | + return 1; |
|
| 64 | + } |
|
| 63 | 65 | |
| 64 | 66 | return 0; |
| 65 | 67 | } |