@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $myForm = $this->handleCreateForm( |
59 | 59 | $request, |
60 | 60 | $event, |
61 | - function () use ($event) { |
|
61 | + function() use ($event) { |
|
62 | 62 | return $this->prePersistActions($event); |
63 | 63 | } |
64 | 64 | ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $myForm = $this->handleUpdateForm( |
88 | 88 | $request, |
89 | 89 | $event, |
90 | - function () use ($event) { |
|
90 | + function() use ($event) { |
|
91 | 91 | return $this->prePersistActions($event); |
92 | 92 | } |
93 | 93 | ); |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | { |
46 | 46 | //prepare resources |
47 | 47 | $templateName = 'default.json'; |
48 | - $template = file_get_contents($this->publicDir.'/templates/'.$templateName); |
|
49 | - $json = file_get_contents(__DIR__.'/Resources/events.json'); |
|
48 | + $template = file_get_contents($this->publicDir . '/templates/' . $templateName); |
|
49 | + $json = file_get_contents(__DIR__ . '/Resources/events.json'); |
|
50 | 50 | |
51 | 51 | //fill semester with events |
52 | 52 | $semesters = $manager->getRepository(Semester::class)->findAll(); |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** @var Event[] $events */ |
61 | - $events = $this->serializer->deserialize($json, Event::class.'[]', 'json'); |
|
61 | + $events = $this->serializer->deserialize($json, Event::class . '[]', 'json'); |
|
62 | 62 | foreach ($events as $event) { |
63 | 63 | $event->setSemester($semester); |
64 | 64 | $event->setTemplateName($templateName); |
65 | 65 | $event->setTemplate($template); |
66 | - $event->setFeedbackStartTime($event->getFeedbackStartTime().':00'); |
|
67 | - $event->setFeedbackEndTime($event->getFeedbackEndTime().':00'); |
|
66 | + $event->setFeedbackStartTime($event->getFeedbackStartTime() . ':00'); |
|
67 | + $event->setFeedbackEndTime($event->getFeedbackEndTime() . ':00'); |
|
68 | 68 | $manager->persist($event); |
69 | 69 | } |
70 | 70 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | foreach ($semesters as $semesterName) { |
30 | 30 | $semester = new Semester(); |
31 | 31 | $semester->setName($semesterName); |
32 | - $semester->setCreationDate((new \DateTime('today'))->modify('+'.$count++.' day')); |
|
32 | + $semester->setCreationDate((new \DateTime('today'))->modify('+' . $count++ . ' day')); |
|
33 | 33 | $manager->persist($semester); |
34 | 34 | } |
35 | 35 | $manager->flush(); |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | $now = (new \DateTime())->format('Y-m-d'); |
46 | 46 | |
47 | 47 | //prepare participants |
48 | - $dir = __DIR__.'/Resources/participants'; |
|
48 | + $dir = __DIR__ . '/Resources/participants'; |
|
49 | 49 | $fileNames = scandir($dir); |
50 | 50 | /** @var Answer[][] $participantJson */ |
51 | 51 | $participantJson = []; |
52 | 52 | foreach ($fileNames as $fileName) { |
53 | 53 | //filter out folder links |
54 | 54 | if ('.' !== $fileName && '..' !== $fileName) { |
55 | - $participantJson[] = file_get_contents($dir.'/'.$fileName); |
|
55 | + $participantJson[] = file_get_contents($dir . '/' . $fileName); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $participant->setTimeNeededInSeconds(rand(0, 60 * 3)); |
68 | 68 | |
69 | 69 | /** @var Answer[] $answers */ |
70 | - $answers = $this->serializer->deserialize($json, Answer::class.'[]', 'json'); |
|
70 | + $answers = $this->serializer->deserialize($json, Answer::class . '[]', 'json'); |
|
71 | 71 | foreach ($answers as $answer) { |
72 | 72 | $answer->setParticipant($participant); |
73 | 73 | $manager->persist($answer); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if ($date instanceof \DateTime) { |
63 | 63 | $dateFormat = $this->translator->trans('time.format.date', [], 'framework'); |
64 | 64 | |
65 | - return $this->prependDayName($date).', '.$date->format($dateFormat); |
|
65 | + return $this->prependDayName($date) . ', ' . $date->format($dateFormat); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return '-'; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | if ($date instanceof \DateTime) { |
79 | 79 | $dateTimeFormat = $this->translator->trans('time.format.date_time', [], 'framework'); |
80 | 80 | |
81 | - return $this->prependDayName($date).', '.$date->format($dateTimeFormat); |
|
81 | + return $this->prependDayName($date) . ', ' . $date->format($dateTimeFormat); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | return '-'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | private function prependDayName(DateTime $date) |
107 | 107 | { |
108 | - return $this->translator->trans('time.weekdays.'.$date->format('D'), [], 'framework'); |
|
108 | + return $this->translator->trans('time.weekdays.' . $date->format('D'), [], 'framework'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | foreach ($choices as $name => $value) { |
84 | 84 | $res[mb_strtolower($name)] = $value; |
85 | 85 | } |
86 | - $transDomain = 'enum_'.$this->camelCaseToTranslation($reflection->getShortName()); |
|
86 | + $transDomain = 'enum_' . $this->camelCaseToTranslation($reflection->getShortName()); |
|
87 | 87 | |
88 | 88 | return ['translation_domain' => $transDomain, 'label' => 'enum.name', 'choices' => $res, 'choice_translation_domain' => $transDomain]; |
89 | 89 | } catch (\ReflectionException $e) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | try { |
106 | 106 | $reflection = new ReflectionClass(static::class); |
107 | 107 | |
108 | - return $translator->trans($this->getTextInternal($enumValue, $reflection), [], 'enum_'.$this->camelCaseToTranslation($reflection->getShortName())); |
|
108 | + return $translator->trans($this->getTextInternal($enumValue, $reflection), [], 'enum_' . $this->camelCaseToTranslation($reflection->getShortName())); |
|
109 | 109 | } catch (\ReflectionException $e) { |
110 | 110 | //this never fails because the class clearly exists |
111 | 111 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $startEntity = clone $defaultEntity; |
59 | 59 | |
60 | 60 | //create persist callable |
61 | - $myOnSuccessCallable = function ($form) use ($defaultEntity, $beforeCreateCallable, $successfulText, $formType, $startEntity, $buttonLabel) { |
|
61 | + $myOnSuccessCallable = function($form) use ($defaultEntity, $beforeCreateCallable, $successfulText, $formType, $startEntity, $buttonLabel) { |
|
62 | 62 | $manager = $this->getDoctrine()->getManager(); |
63 | 63 | |
64 | 64 | if (!\is_callable($beforeCreateCallable) || false !== $beforeCreateCallable($manager)) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $successfulText = $translator->trans('form.successful.updated', [], 'framework'); |
99 | 99 | |
100 | 100 | //create persist callable |
101 | - $myOnSuccessCallable = function ($form) use ($entity, $beforeUpdateCallable, $successfulText) { |
|
101 | + $myOnSuccessCallable = function($form) use ($entity, $beforeUpdateCallable, $successfulText) { |
|
102 | 102 | $manager = $this->getDoctrine()->getManager(); |
103 | 103 | |
104 | 104 | if (!\is_callable($beforeUpdateCallable) || false !== $beforeUpdateCallable($manager)) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $translator->trans('form.submit_buttons.delete', [], 'framework'), |
138 | 138 | $translator->trans('form.successful.deleted', [], 'framework'), |
139 | 139 | $beforeDeleteCallable ?? |
140 | - function () { |
|
140 | + function() { |
|
141 | 141 | return true; |
142 | 142 | } |
143 | 143 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | private function handleDeleteFormInternal(Request $request, BaseEntity $entity, $formType, $buttonLabel, $successText, $beforeDeleteCallable) |
157 | 157 | { |
158 | - $myOnSuccessCallable = function ($form) use ($entity, $successText, $beforeDeleteCallable) { |
|
158 | + $myOnSuccessCallable = function($form) use ($entity, $successText, $beforeDeleteCallable) { |
|
159 | 159 | $manager = $this->getDoctrine()->getManager(); |
160 | 160 | |
161 | 161 | if (false !== $beforeDeleteCallable($entity, $manager)) { |
@@ -193,6 +193,6 @@ discard block |
||
193 | 193 | { |
194 | 194 | $className = mb_substr($classWithNamespace, mb_strrpos($classWithNamespace, '\\') + 1); |
195 | 195 | |
196 | - return 'App\\Form\\'.$className.'\\'.$prepend.($repeatClass ? $className : '').'Type'; |
|
196 | + return 'App\\Form\\' . $className . '\\' . $prepend . ($repeatClass ? $className : '') . 'Type'; |
|
197 | 197 | } |
198 | 198 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | private function displayFlash($type, $message, $link = null) |
73 | 73 | { |
74 | 74 | if (null !== $link) { |
75 | - $message = '<a href="'.$link.'">'.$message.'</a>'; |
|
75 | + $message = '<a href="' . $link . '">' . $message . '</a>'; |
|
76 | 76 | } |
77 | 77 | $this->get('session')->getFlashBag()->set($type, $message); |
78 | 78 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | //get all templates |
47 | 47 | $templates = []; |
48 | - foreach (scandir($this->publicDir.'/templates') as $template) { |
|
48 | + foreach (scandir($this->publicDir . '/templates') as $template) { |
|
49 | 49 | if ($this->endsWith($template, '.json')) { |
50 | 50 | $templates[mb_substr($template, 0, -5)] = $template; |
51 | 51 | } |