Skip to content

Commit 794d6c1

Browse files
committed
CS
1 parent df5797a commit 794d6c1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Extension/Session/SessionListener.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
class SessionListener implements EventSubscriberInterface
1616
{
17+
1718
public static function getSubscribedEvents()
1819
{
19-
return array(
20+
return [
2021
FormEvents::PRE_SET_DATA => 'preSet',
21-
);
22+
];
2223
}
2324

2425
public function preSet(FormEvent $event)
@@ -27,8 +28,7 @@ public function preSet(FormEvent $event)
2728
$rootName = $form->getRoot()->getName();
2829
$parent = $form->getParent();
2930

30-
if (
31-
$parent
31+
if ($parent
3232
&& $form->getName() !== '_token'
3333
&& !($parent->getConfig()->getType()->getInnerType() instanceof ChoiceType)
3434
) {
@@ -37,10 +37,8 @@ public function preSet(FormEvent $event)
3737

3838
// Get the input from the previous submit
3939
$oldValue = session()->getOldInput($fullName);
40-
if (! is_null($oldValue)) {
41-
40+
if (!is_null($oldValue)) {
4241
// Transform back to good data
43-
4442
try {
4543
$value = $this->transformValue($event, $oldValue);
4644

@@ -85,6 +83,7 @@ protected function getFullName($rootName, $dottedName)
8583
/**
8684
* @param FormEvent $event
8785
* @param mixed $value
86+
*
8887
* @return mixed
8988
*/
9089
protected function transformValue(FormEvent $event, $value)

0 commit comments

Comments
 (0)