Completed
Push — feature/pilot_information ( cc067b...4835e7 )
by Laurent
01:49
created
Http/Web/Controller/PilotEditController.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
16 16
 final class PilotEditController extends WebController
17 17
 {
18 18
 
19
-    public function index(){
19
+    public function index() {
20 20
         $id = $this->request->getParam('id');
21 21
 
22
-        if($id === null){
22
+        if ($id === null) {
23 23
             $this->renderHtml('<p>Paramètre ID non fournis.</p>');
24 24
             return;
25 25
         }
26 26
 
27 27
         $command = new CreateUpdatePilotInformationCommand($id);
28 28
 
29
-        if($this->getPilotRepository()->exist(PilotId::create($id))){
29
+        if ($this->getPilotRepository()->exist(PilotId::create($id))) {
30 30
             $command->fromPilot($this->getPilotRepository()->getById(PilotId::create($id)));
31 31
         }
32 32
 
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
         $user = new \User($this->db);
37 37
         $user->fetch($id);
38 38
 
39
-        if($this->request->isPost()){
39
+        if ($this->request->isPost()) {
40 40
             $form->setData($this->request->getPostParameters());
41 41
 
42
-            if(!$form->validate()){
42
+            if (!$form->validate()) {
43 43
                 return $this->render('pilot/edit.phtml', [
44 44
                     'form' => $form,
45 45
                 ]);
46 46
             }
47 47
 
48
-            try{
48
+            try {
49 49
                 $this->handle($form->getObject());
50
-                return $this->redirect($_SERVER["PHP_SELF"].'?id='.$id.'&r=list_members');
51
-            }catch(\Exception $e){
50
+                return $this->redirect($_SERVER["PHP_SELF"] . '?id=' . $id . '&r=list_members');
51
+            } catch (\Exception $e) {
52 52
                 print $e->getMessage();
53 53
                 dol_syslog($e->getMessage(), LOG_ERR);
54 54
             }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * @return CreateUpdatePilotInformationCommandHandler()
78 78
      */
79
-    private function getHandler(){
79
+    private function getHandler() {
80 80
         return new CreateUpdatePilotInformationCommandHandler($this->getPilotRepository());
81 81
     }
82 82
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             try{
49 49
                 $this->handle($form->getObject());
50 50
                 return $this->redirect($_SERVER["PHP_SELF"].'?id='.$id.'&r=list_members');
51
-            }catch(\Exception $e){
51
+            } catch(\Exception $e){
52 52
                 print $e->getMessage();
53 53
                 dol_syslog($e->getMessage(), LOG_ERR);
54 54
             }
Please login to merge, or discard this patch.