@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * @return mixed |
|
| 248 | + * @return null|Category |
|
| 249 | 249 | */ |
| 250 | 250 | public function getCategory() |
| 251 | 251 | { |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | - * @param mixed $category |
|
| 256 | + * @param null|Category $category |
|
| 257 | 257 | */ |
| 258 | 258 | public function setCategory(Category $category = null) |
| 259 | 259 | { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
| 264 | - * @return mixed |
|
| 264 | + * @return ArrayCollection |
|
| 265 | 265 | */ |
| 266 | 266 | public function getQuestions() |
| 267 | 267 | { |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | - * @return mixed |
|
| 291 | + * @return ArrayCollection |
|
| 292 | 292 | */ |
| 293 | 293 | public function getModulesUser() |
| 294 | 294 | { |
@@ -22,7 +22,6 @@ discard block |
||
| 22 | 22 | protected $service; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * @param ImageManagerServices $container |
|
| 26 | 25 | */ |
| 27 | 26 | public function __construct(ImageManagerServices $service) |
| 28 | 27 | { |
@@ -30,7 +29,7 @@ discard block |
||
| 30 | 29 | } |
| 31 | 30 | |
| 32 | 31 | /** |
| 33 | - * @return array |
|
| 32 | + * @return string[] |
|
| 34 | 33 | */ |
| 35 | 34 | public function getSubscribedEvents() |
| 36 | 35 | { |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: device |
|
| 5 | - * Date: 23.02.16 |
|
| 6 | - * Time: 10:00 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: device |
|
| 5 | + * Date: 23.02.16 |
|
| 6 | + * Time: 10:00 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Entity; |
| 10 | 10 | |
@@ -41,10 +41,10 @@ |
||
| 41 | 41 | $role = User::ROLE_ADMIN; |
| 42 | 42 | |
| 43 | 43 | $em = $this->doctrine->getManager(); |
| 44 | - $user = $em->getRepository('AppBundle:User')->findBy(['email' => $email]); |
|
| 44 | + $user = $em->getRepository('AppBundle:User')->findBy([ 'email' => $email ]); |
|
| 45 | 45 | if (!$user) |
| 46 | 46 | $user = new User(); |
| 47 | - else $user = $user[0]; |
|
| 47 | + else $user = $user[ 0 ]; |
|
| 48 | 48 | |
| 49 | 49 | $pass = $this->userPasswordEncoder->encodePassword($user, $password); |
| 50 | 50 | $user->setEmail($email); |
@@ -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 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return new RedirectResponse($this->router->generate('homepage')); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - return ['form' => $form->createView()]; |
|
| 101 | + return [ 'form' => $form->createView() ]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function updateRegistrationUser(Request $request, User $user) |
@@ -120,6 +120,6 @@ discard block |
||
| 120 | 120 | return new RedirectResponse($this->router->generate('homepage')); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - return ['form' => $form->createView()]; |
|
| 123 | + return [ 'form' => $form->createView() ]; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | \ No newline at end of file |
@@ -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 | } |
@@ -43,6 +43,6 @@ |
||
| 43 | 43 | $this->getContainer()->get('app.admin.creator') |
| 44 | 44 | ->create($email, $password, $firstName, $lastName); |
| 45 | 45 | |
| 46 | - $output->writeln(sprintf('User <comment>%s</comment> was created/updated', $firstName.' '.$lastName)); |
|
| 46 | + $output->writeln(sprintf('User <comment>%s</comment> was created/updated', $firstName . ' ' . $lastName)); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace AppBundle\Controller\Admin; |
| 4 | 4 | |
| 5 | -use AppBundle\Entity\Answer; |
|
| 6 | 5 | use AppBundle\Entity\Module; |
| 7 | 6 | use AppBundle\Entity\Question; |
| 8 | 7 | use AppBundle\Form\QuestionType; |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | $module = $em->getRepository('AppBundle:Module')->find($idModule); |
| 28 | 28 | $question = new Question(); |
| 29 | 29 | |
| 30 | - $maxSort = $em->getRepository('AppBundle:Question')->findMaxSortByModuleId($idModule); |
|
| 30 | + $maxSort = $em->getRepository('AppBundle:Question')->findMaxSortByModuleId($idModule); |
|
| 31 | 31 | |
| 32 | - $form = $this->createForm(QuestionType::class, $question, ['new_sort'=> ++$maxSort['max_sort']]); |
|
| 32 | + $form = $this->createForm(QuestionType::class, $question, [ 'new_sort'=> ++$maxSort[ 'max_sort' ] ]); |
|
| 33 | 33 | |
| 34 | 34 | $form->handleRequest($request); |
| 35 | 35 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return ['form' => $form->createView(), |
|
| 45 | + return [ 'form' => $form->createView(), |
|
| 46 | 46 | 'idModule' => $idModule |
| 47 | 47 | ]; |
| 48 | 48 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | return $this->redirectToRoute('edit_question', array('id' => $id, 'idModule' => $idModule)); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - return ['form' => $form->createView(), |
|
| 85 | + return [ 'form' => $form->createView(), |
|
| 86 | 86 | 'idModule' => $idModule |
| 87 | 87 | ]; |
| 88 | 88 | } |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | $question = $em->getRepository('AppBundle:Question') |
| 117 | 117 | ->findByModuleWithSorting($idModule); |
| 118 | 118 | |
| 119 | - $form_delete = []; |
|
| 119 | + $form_delete = [ ]; |
|
| 120 | 120 | |
| 121 | 121 | foreach ($question as $item) { |
| 122 | - $form_delete[$item->getId()] = $this->createFormDelete($item->getId(), $idModule)->createView(); |
|
| 122 | + $form_delete[ $item->getId() ] = $this->createFormDelete($item->getId(), $idModule)->createView(); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | return [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | private function createFormDelete($id, $idModule) |
| 137 | 137 | { |
| 138 | 138 | return $this->createFormBuilder() |
| 139 | - ->setAction($this->generateUrl('remove_question', ['id' => $id, 'idModule' => $idModule])) |
|
| 139 | + ->setAction($this->generateUrl('remove_question', [ 'id' => $id, 'idModule' => $idModule ])) |
|
| 140 | 140 | ->setMethod('DELETE') |
| 141 | 141 | ->add('submit', SubmitType::class, [ |
| 142 | 142 | 'label' => ' ', |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
| 8 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
| 9 | 9 | use AppBundle\Entity\User; |
| 10 | -use AppBundle\Form\UserType; |
|
| 11 | 10 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
| 12 | 11 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
| 13 | 12 | |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | $em = $this->getDoctrine()->getManager(); |
| 31 | 31 | $users = $em->getRepository('AppBundle:User')->findUsersWithoutRole(User::ROLE_ADMIN); |
| 32 | 32 | |
| 33 | - $form_delete = []; |
|
| 33 | + $form_delete = [ ]; |
|
| 34 | 34 | |
| 35 | 35 | foreach ($users as $item) { |
| 36 | - $form_delete[$item->getId()] = $this->createFormDelete($item->getId())->createView(); |
|
| 36 | + $form_delete[ $item->getId() ] = $this->createFormDelete($item->getId())->createView(); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return [ |
@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | private function createFormDelete($id) |
| 98 | 98 | { |
| 99 | 99 | return $this->createFormBuilder() |
| 100 | - ->setAction($this->generateUrl('user_delete', ['id' => $id])) |
|
| 100 | + ->setAction($this->generateUrl('user_delete', [ 'id' => $id ])) |
|
| 101 | 101 | ->setMethod('DELETE') |
| 102 | - ->add('submit', SubmitType::class, ['label' => ' ', |
|
| 102 | + ->add('submit', SubmitType::class, [ 'label' => ' ', |
|
| 103 | 103 | 'attr' => [ |
| 104 | 104 | 'class' => 'glyphicon glyphicon-remove btn-link', |
| 105 | 105 | 'onclick' => 'return confirm("Are you sure?")' |
| 106 | - ]]) |
|
| 106 | + ] ]) |
|
| 107 | 107 | ->getForm(); |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | \ No newline at end of file |