@@ -233,7 +233,7 @@ |
||
| 233 | 233 | */ |
| 234 | 234 | public function getRoles() |
| 235 | 235 | { |
| 236 | - return [$this->role]; |
|
| 236 | + return [ $this->role ]; |
|
| 237 | 237 | |
| 238 | 238 | } |
| 239 | 239 | |
@@ -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); |
@@ -94,6 +94,6 @@ |
||
| 94 | 94 | return new RedirectResponse($this->router->generate('homepage')); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - return ['form' => $form->createView()]; |
|
| 97 | + return [ 'form' => $form->createView() ]; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 13 | 13 | { |
| 14 | 14 | $builder |
| 15 | - ->add('textAnswer', TextType::class,[ |
|
| 15 | + ->add('textAnswer', TextType::class, [ |
|
| 16 | 16 | 'attr' => [ |
| 17 | 17 | 'class' => 'form-control', |
| 18 | 18 | 'placeholder' => 'enter answer' |
@@ -37,13 +37,13 @@ |
||
| 37 | 37 | ]) |
| 38 | 38 | ->add('course', EntityType::class, [ |
| 39 | 39 | 'class' => 'AppBundle\Entity\Category', |
| 40 | - 'query_builder' => function (EntityRepository $er) { |
|
| 40 | + 'query_builder' => function(EntityRepository $er) { |
|
| 41 | 41 | return $er->createQueryBuilder('c') |
| 42 | 42 | ->orderBy('c.title', 'ASC'); |
| 43 | 43 | }, |
| 44 | 44 | 'label' => 'Course', |
| 45 | 45 | 'property' => 'title', |
| 46 | - 'attr' => ['class' => 'form-control'], |
|
| 46 | + 'attr' => [ 'class' => 'form-control' ], |
|
| 47 | 47 | 'required' => true |
| 48 | 48 | ]) |
| 49 | 49 | ->add('plain_password', RepeatedType::class, [ |
@@ -21,25 +21,25 @@ discard block |
||
| 21 | 21 | 'placeholder' => 'enter title' |
| 22 | 22 | ] |
| 23 | 23 | ]) |
| 24 | - ->add('rating', TextType::class,[ |
|
| 24 | + ->add('rating', TextType::class, [ |
|
| 25 | 25 | 'attr' => [ |
| 26 | 26 | 'class' => 'form-control', |
| 27 | 27 | 'placeholder' => 'enter rating' |
| 28 | 28 | ] |
| 29 | 29 | ]) |
| 30 | - ->add('persentSuccess', TextType::class,[ |
|
| 30 | + ->add('persentSuccess', TextType::class, [ |
|
| 31 | 31 | 'attr' => [ |
| 32 | 32 | 'class' => 'form-control', |
| 33 | 33 | 'placeholder' => 'enter persent' |
| 34 | 34 | ] |
| 35 | 35 | ]) |
| 36 | - ->add('time', TextType::class,[ |
|
| 36 | + ->add('time', TextType::class, [ |
|
| 37 | 37 | 'attr' => [ |
| 38 | 38 | 'class' => 'form-control', |
| 39 | 39 | 'placeholder' => 'enter time' |
| 40 | 40 | ] |
| 41 | 41 | ]) |
| 42 | - ->add('attempts', TextType::class,[ |
|
| 42 | + ->add('attempts', TextType::class, [ |
|
| 43 | 43 | 'attr' => [ |
| 44 | 44 | 'class' => 'form-control', |
| 45 | 45 | 'placeholder' => 'enter attempts' |
@@ -47,13 +47,13 @@ discard block |
||
| 47 | 47 | ]) |
| 48 | 48 | ->add('category', EntityType::class, [ |
| 49 | 49 | 'class' => 'AppBundle\Entity\Category', |
| 50 | - 'query_builder' => function (EntityRepository $er) { |
|
| 50 | + 'query_builder' => function(EntityRepository $er) { |
|
| 51 | 51 | return $er->createQueryBuilder('c') |
| 52 | 52 | ->orderBy('c.title', 'ASC'); |
| 53 | 53 | }, |
| 54 | 54 | 'label' => 'Category', |
| 55 | 55 | 'property' => 'title', |
| 56 | - 'attr' => ['class' => 'form-control'], |
|
| 56 | + 'attr' => [ 'class' => 'form-control' ], |
|
| 57 | 57 | 'required' => true |
| 58 | 58 | ]) |
| 59 | 59 | ->add('module_image', FileType::class, [ |
@@ -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 | } |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function adminAction() |
| 17 | 17 | { |
| 18 | - return []; |
|
| 18 | + return [ ]; |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return $this->redirectToRoute('create_question', array('module' => $module)); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - return ['form' => $form->createView()]; |
|
| 35 | + return [ 'form' => $form->createView() ]; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $this->redirectToRoute('show_module'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return ['form' => $form->createView()]; |
|
| 58 | + return [ 'form' => $form->createView() ]; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | $em = $this->getDoctrine()->getManager(); |
| 85 | 85 | |
| 86 | 86 | $module = $em->getRepository('AppBundle:Module') |
| 87 | - ->findBy([],['createdAt' => 'DESC']); |
|
| 87 | + ->findBy([ ], [ 'createdAt' => 'DESC' ]); |
|
| 88 | 88 | |
| 89 | - $form_edit = []; |
|
| 90 | - $form_delete = []; |
|
| 89 | + $form_edit = [ ]; |
|
| 90 | + $form_delete = [ ]; |
|
| 91 | 91 | |
| 92 | 92 | foreach ($module as $item) { |
| 93 | - $form_edit[$item->getId()] = $this->createFormEdit($item->getId())->createView(); |
|
| 94 | - $form_delete[$item->getId()] = $this->createFormDelete($item->getId())->createView(); |
|
| 93 | + $form_edit[ $item->getId() ] = $this->createFormEdit($item->getId())->createView(); |
|
| 94 | + $form_delete[ $item->getId() ] = $this->createFormDelete($item->getId())->createView(); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return [ |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | private function createFormEdit($id) |
| 109 | 109 | { |
| 110 | 110 | return $this->createFormBuilder() |
| 111 | - ->setAction($this->generateUrl('edit_module', ['id' => $id])) |
|
| 111 | + ->setAction($this->generateUrl('edit_module', [ 'id' => $id ])) |
|
| 112 | 112 | ->setMethod('PUT') |
| 113 | 113 | ->add('submit', SubmitType::class, [ |
| 114 | 114 | 'label' => ' ', |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | private function createFormDelete($id) |
| 126 | 126 | { |
| 127 | 127 | return $this->createFormBuilder() |
| 128 | - ->setAction($this->generateUrl('remove_module', ['id' => $id])) |
|
| 128 | + ->setAction($this->generateUrl('remove_module', [ 'id' => $id ])) |
|
| 129 | 129 | ->setMethod('DELETE') |
| 130 | 130 | ->add('submit', SubmitType::class, [ |
| 131 | 131 | 'label' => ' ', |