Passed
Branch master (95796a)
by Andreas
38:22
created
src/midcom/datamanager/extension/formextension.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function configureOptions(OptionsResolver $resolver)
22 22
     {
23
-        $resolver->setDefaults(array
24
-        (
23
+        $resolver->setDefaults(array(
25 24
             'widget_config' => array(),
26 25
             'type_config' => array(),
27 26
             'dm2_type' => null,
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/schemaextension.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
             new type\radiocheckselect,
29 29
             new type\subform,
30 30
             new type\select,
31
-        	new type\tinymce,
31
+            new type\tinymce,
32 32
             new type\toolbar,
33 33
         );
34 34
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,7 @@
 block discarded – undo
99 99
 
100 100
     public function count($kept = false)
101 101
     {
102
-        return array
103
-        (
102
+        return array(
104 103
             'message_receipt' => $this->get_message_receipt_qb($kept)->count_unchecked(),
105 104
             'link_log' => $this->get_link_log_qb($kept)->count_unchecked(),
106 105
             'campaign_member' => $this->get_campaign_member_qb($kept)->count_unchecked(),
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/jsdate.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
             }
35 35
         }
36 36
 
37
-        if (   $input === null
38
-            || (   $input instanceof DateTime
37
+        if ($input === null
38
+            || ($input instanceof DateTime
39 39
                 && $input->format('Y-m-d H:i:s') == '0001-01-01 00:00:00'))
40 40
         {
41 41
             return $result;
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function reverseTransform($array)
63 63
     {
64
-        if (!is_array($array) ) {
64
+        if (!is_array($array)) {
65 65
             throw new TransformationFailedException('Expected an array.');
66 66
         }
67 67
 
68 68
         if (empty($array['date'])
69
-            || (   $array['date'] instanceof DateTime
69
+            || ($array['date'] instanceof DateTime
70 70
                 && $array['date']->format('Y-m-d H:i:s') == '0001-01-01 00:00:00'))
71 71
         {
72 72
             return;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@  discard block
 block discarded – undo
45 45
         if ($this->config['type_config']['storage_type'] === datetype::UNIXTIME)
46 46
         {
47 47
             $date->setTimestamp($input);
48
-        }
49
-        else if ($this->config['type_config']['storage_type'] === datetype::ISO)
48
+        } else if ($this->config['type_config']['storage_type'] === datetype::ISO)
50 49
         {
51 50
             $date->modify($input);
52 51
         }
@@ -79,8 +78,7 @@  discard block
 block discarded – undo
79 78
         if ($this->config['type_config']['storage_type'] === datetype::UNIXTIME)
80 79
         {
81 80
             return $array['date']->format('U');
82
-        }
83
-        else if ($this->config['type_config']['storage_type'] === datetype::ISO)
81
+        } else if ($this->config['type_config']['storage_type'] === datetype::ISO)
84 82
         {
85 83
             return $array['date']->format('Y-m-d H:i:s');
86 84
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     public function transform($array)
21 21
     {
22
-        if (!is_array($array) ) {
22
+        if (!is_array($array)) {
23 23
             throw new TransformationFailedException('Expected an array.');
24 24
         }
25 25
 
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/blobs.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
         {
51 51
             $description = $attachment->get_parameter('midcom.helper.datamanager2.type.blobs', 'description');
52 52
         }
53
-        return array
54
-        (
53
+        return array(
55 54
             'filename' => $attachment->name,
56 55
             'description' => $description,
57 56
             'title' => $attachment->title,
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
         $title = (!empty($data['title'])) ? $data['title'] : $data['file']['name'];
82 81
         $description = (array_key_exists('description', $data)) ? $data['description'] : $title;
83 82
         $stat = stat($data['file']['tmp_name']);
84
-        return array
85
-        (
83
+        return array(
86 84
             'filename' => $data['file']['name'],
87 85
             'description' => $description,
88 86
             'title' => $title,
@@ -104,7 +102,7 @@  discard block
 block discarded – undo
104 102
 
105 103
     public function reverseTransform($array)
106 104
     {
107
-        if (!is_array($array) ) {
105
+        if (!is_array($array)) {
108 106
             throw new TransformationFailedException('Expected an array.');
109 107
         }
110 108
 
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/autocomplete.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function transform($input)
23 23
     {
24
-        if (   $this->config['dm2_type'] == 'select'
24
+        if ($this->config['dm2_type'] == 'select'
25 25
             && $this->config['type_config']['allow_multiple'])
26 26
         {
27 27
             switch ($this->config['type_config']['multiple_storagemode'])
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function reverseTransform($array)
45 45
     {
46
-        if (!is_array($array) ) {
46
+        if (!is_array($array)) {
47 47
             throw new TransformationFailedException('Expected an array.');
48 48
         }
49 49
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             return reset($array['selection']);
58 58
         }
59 59
 
60
-        if (   $this->config['dm2_type'] == 'select'
60
+        if ($this->config['dm2_type'] == 'select'
61 61
             && $this->config['type_config']['allow_multiple'])
62 62
         {
63 63
             switch ($this->config['type_config']['multiple_storagemode'])
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/photo.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,13 +25,11 @@
 block discarded – undo
25 25
             {
26 26
                 //This is converting from storage
27 27
                 $result[$key] = $this->transform_persistent($value);
28
-            }
29
-            else if (!empty($value['object']))
28
+            } else if (!empty($value['object']))
30 29
             {
31 30
                 //This is during validation errors
32 31
                 $result[$key] = $this->transform_persistent($value['object']);
33
-            }
34
-            else if ($value !== null)
32
+            } else if ($value !== null)
35 33
             {
36 34
                 $result[$key] = $this->transform_nonpersistent(array('file' => $value, 'identifier' => 'archival'));
37 35
             }
Please login to merge, or discard this patch.
src/midcom/datamanager/schema.php 2 patches
Spacing   +7 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 class schema
20 20
 {
21
-    private $defaults = array
22
-    (
21
+    private $defaults = array(
23 22
         'operations' => array('save' => '', 'cancel' => '')
24 23
     );
25 24
 
@@ -64,8 +63,7 @@  discard block
 block discarded – undo
64 63
     {
65 64
         foreach ($this->config['fields'] as $name => $config)
66 65
         {
67
-            $options = array
68
-            (
66
+            $options = array(
69 67
                 'label' => $config['title'],
70 68
                 'widget_config' => $config['widget_config'],
71 69
                 'type_config' => $config['type_config'],
@@ -138,8 +136,7 @@  discard block
 block discarded – undo
138 136
     {
139 137
         $resolver = new OptionsResolver();
140 138
 
141
-        $resolver->setDefaults(array
142
-        (
139
+        $resolver->setDefaults(array(
143 140
             'title' => '',
144 141
             'type' => null,
145 142
             'type_config' => array(),
@@ -154,9 +151,9 @@  discard block
 block discarded – undo
154 151
             'end_fieldset' => null
155 152
         ));
156 153
 
157
-        $normalize_widget = function (Options $options, $value) use ($name)
154
+        $normalize_widget = function(Options $options, $value) use ($name)
158 155
         {
159
-            if (   $value == 'images'
156
+            if ($value == 'images'
160 157
                 || $value == 'downloads')
161 158
             {
162 159
                 return 'subform';
@@ -164,10 +161,9 @@  discard block
 block discarded – undo
164 161
             return $value;
165 162
         };
166 163
 
167
-        $normalize_storage = function (Options $options, $value) use ($name)
164
+        $normalize_storage = function(Options $options, $value) use ($name)
168 165
         {
169
-            $default = array
170
-            (
166
+            $default = array(
171 167
                 'location' => 'parameter',
172 168
                 'domain' => 'midcom.helper.datamanager2',
173 169
                 'name' => $name
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
             if (array_key_exists($this->_schema, $schemadb))
69 69
             {
70 70
                 $schema_name = $this->_schema;
71
-            }
72
-            else
71
+            } else
73 72
             {
74 73
                 $schema_name = key($schemadb);
75 74
             }
@@ -110,8 +109,7 @@  discard block
 block discarded – undo
110 109
             {
111 110
                 $this->_rows[] = array($row);
112 111
             }
113
-        }
114
-        else
112
+        } else
115 113
         {
116 114
             $this->_rows = $rows;
117 115
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/controller.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@
 block discarded – undo
48 48
 
49 49
     public function process()
50 50
     {
51
-    	if (!$this->form->isSubmitted())
52
-    	{
53
-        	$this->form->handleRequest();
54
-    	}
51
+        if (!$this->form->isSubmitted())
52
+        {
53
+            $this->form->handleRequest();
54
+        }
55 55
         // we add the stylesheet regardless of processing result, since save does not automatically mean relocate...
56 56
         midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.datamanager/default.css");
57 57
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         if ($this->form->isSubmitted())
59 59
         {
60 60
             $button = $this->form->getClickedButton();
61
-            if (   $button
61
+            if ($button
62 62
                 && $button->getConfig()->getOption('operation') == self::CANCEL)
63 63
             {
64 64
                 return self::CANCEL;
Please login to merge, or discard this patch.