@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: device |
|
| 5 | - * Date: 23.03.16 |
|
| 6 | - * Time: 18:35 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: device |
|
| 5 | + * Date: 23.03.16 |
|
| 6 | + * Time: 18:35 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Controller; |
| 10 | 10 | |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 19 | 19 | { |
| 20 | - $newSort = $options['new_sort']; |
|
| 20 | + $newSort = $options[ 'new_sort' ]; |
|
| 21 | 21 | $sortAttrs = [ |
| 22 | 22 | 'attr' => [ |
| 23 | 23 | 'class' => 'form-control', |
| 24 | 24 | ], |
| 25 | - 'choices' => [1=>1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], |
|
| 25 | + 'choices' => [ 1=>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ], |
|
| 26 | 26 | 'choices_as_values' => true, |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - if($newSort)$sortAttrs['data'] = $newSort; |
|
| 29 | + if ($newSort)$sortAttrs[ 'data' ] = $newSort; |
|
| 30 | 30 | |
| 31 | 31 | $builder |
| 32 | 32 | ->add('textQuestion', TextType::class, [ |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | ], |
| 51 | 51 | |
| 52 | 52 | ]) |
| 53 | - ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 53 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 54 | 54 | $data = $event->getData(); |
| 55 | 55 | |
| 56 | 56 | foreach ($data->getAnswers() as $item) { |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | 'choices_as_values' => true, |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - if($newSort)$sortAttrs['data'] = $newSort; |
|
| 29 | + if($newSort) { |
|
| 30 | + $sortAttrs['data'] = $newSort; |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | $builder |
| 32 | 34 | ->add('textQuestion', TextType::class, [ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - return ['form' => $form->createView()]; |
|
| 37 | + return [ 'form' => $form->createView() ]; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | return $this->redirectToRoute('show_module'); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - return ['module' => $module, |
|
| 61 | - 'form' => $form->createView()]; |
|
| 60 | + return [ 'module' => $module, |
|
| 61 | + 'form' => $form->createView() ]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -101,10 +101,10 @@ discard block |
||
| 101 | 101 | $this->container->getParameter('knp_paginator.page_range') |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | - $form_delete = []; |
|
| 104 | + $form_delete = [ ]; |
|
| 105 | 105 | |
| 106 | 106 | foreach ($module as $item) { |
| 107 | - $form_delete[$item->getId()] = $this->createFormDelete($item->getId())->createView(); |
|
| 107 | + $form_delete[ $item->getId() ] = $this->createFormDelete($item->getId())->createView(); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | return [ |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | private function createFormDelete($id) |
| 121 | 121 | { |
| 122 | 122 | return $this->createFormBuilder() |
| 123 | - ->setAction($this->generateUrl('remove_module', ['id' => $id])) |
|
| 123 | + ->setAction($this->generateUrl('remove_module', [ 'id' => $id ])) |
|
| 124 | 124 | ->setMethod('DELETE') |
| 125 | 125 | ->add('submit', SubmitType::class, [ |
| 126 | 126 | 'label' => ' ', |
@@ -26,10 +26,10 @@ |
||
| 26 | 26 | $countQuestions = $em->getRepository('AppBundle:Question')->findCountQuestions(); |
| 27 | 27 | |
| 28 | 28 | return [ |
| 29 | - 'count_users' => $countUsers['count_u'], |
|
| 30 | - 'count_modules' => $countModules['count_m'], |
|
| 31 | - 'count_categories' => $countCategories['count_c'], |
|
| 32 | - 'count_questions' => $countQuestions['count_q'] |
|
| 29 | + 'count_users' => $countUsers[ 'count_u' ], |
|
| 30 | + 'count_modules' => $countModules[ 'count_m' ], |
|
| 31 | + 'count_categories' => $countCategories[ 'count_c' ], |
|
| 32 | + 'count_questions' => $countQuestions[ 'count_q' ] |
|
| 33 | 33 | ]; |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: device |
|
| 5 | - * Date: 23.02.16 |
|
| 6 | - * Time: 9:45 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: device |
|
| 5 | + * Date: 23.02.16 |
|
| 6 | + * Time: 9:45 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace AppBundle\Repository; |
| 10 | 10 | |