Completed
Pull Request — master (#198)
by
unknown
19:02
created
src/midcom/datamanager/storage/blobs.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
         foreach ($items as $identifier => $guid) {
38 38
             try {
39 39
                 $results[$identifier] = new midcom_db_attachment($guid);
40
-            } catch (midcom_error $e) {
40
+            }
41
+            catch (midcom_error $e) {
41 42
                 $e->log();
42 43
             }
43 44
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
     protected function save_attachment_list()
144 144
     {
145 145
         if (!empty($this->config['widget_config']['sortable'])) {
146
-            uasort($this->map, function ($a, $b) {
146
+            uasort($this->map, function($a, $b) {
147 147
                 if ($a->metadata->score == $b->metadata->score) {
148 148
                     return strnatcasecmp($a->name, $b->name);
149 149
                 }
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/container/dbacontainer.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@
 block discarded – undo
65 65
     private function prepare_field(array $config)
66 66
     {
67 67
         if (   empty($config['storage']['location'])
68
-               // This line is needed because a parameter default is set by the schema parser and then ignored
69
-               // by the type. The things we do for backwards compatibility...
68
+                // This line is needed because a parameter default is set by the schema parser and then ignored
69
+                // by the type. The things we do for backwards compatibility...
70 70
             || $config['storage']['location'] === 'parameter') {
71 71
             if (class_exists('midcom\datamanager\storage\\' . $config['type'])) {
72 72
                 $classname = 'midcom\datamanager\storage\\' . $config['type'];
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             }
33 33
             $config['name'] = $name;
34 34
             $field = $this->prepare_field($config);
35
-            if (   isset($config['default'])
35
+            if (isset($config['default'])
36 36
                 && (!$this->object->id || $field instanceof transientnode)) {
37 37
                 $field->set_value($config['default']);
38 38
             }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     private function prepare_field(array $config)
66 66
     {
67
-        if (   empty($config['storage']['location'])
67
+        if (empty($config['storage']['location'])
68 68
                // This line is needed because a parameter default is set by the schema parser and then ignored
69 69
                // by the type. The things we do for backwards compatibility...
70 70
             || $config['storage']['location'] === 'parameter') {
Please login to merge, or discard this patch.
lib/net/nehmer/blog/handler/view.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,8 @@
 block discarded – undo
218 218
         if ($this->_config->get('comments_topic')) {
219 219
             try {
220 220
                 $comments_topic = new midcom_db_topic($this->_config->get('comments_topic'));
221
-            } catch (midcom_error $e) {
221
+            }
222
+            catch (midcom_error $e) {
222 223
                 return false;
223 224
             }
224 225
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             ]);
45 45
         }
46 46
 
47
-        if (   $this->_article->topic === $this->_topic->id
47
+        if ($this->_article->topic === $this->_topic->id
48 48
             && $this->_article->can_do('midgard:delete')) {
49 49
             $delete = $this->get_workflow('delete', ['object' => $this->_article]);
50 50
             $buttons[] = $delete->get_button("delete/{$this->_article->guid}/");
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         if ($this->_config->get('comments_enable')) {
97 97
             if ($comments_node = $this->_seek_comments()) {
98 98
                 $this->_request_data['comments_url'] = $comments_node[MIDCOM_NAV_RELATIVEURL] . "comment/{$this->_article->guid}";
99
-                if (   $this->_topic->can_do('midgard:update')
99
+                if ($this->_topic->can_do('midgard:update')
100 100
                     && $this->_topic->can_do('net.nehmer.comments:moderation')) {
101 101
                     net_nehmer_comments_viewer::add_head_elements();
102 102
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/mail/exec/test-html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 midcom::get()->auth->require_admin_user();
3 3
 
4
-if (   empty($_POST['to'])
4
+if (empty($_POST['to'])
5 5
     || empty($_POST['from'])) {
6 6
     ?>
7 7
     <h2>Send test email</h2>
Please login to merge, or discard this patch.
web/rootfile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     include dirname(__DIR__) . '/config-default.inc.php';
24 24
 }
25 25
 
26
-if (! defined('MIDCOM_STATIC_URL')) {
26
+if (!defined('MIDCOM_STATIC_URL')) {
27 27
     define('MIDCOM_STATIC_URL', '/midcom-static');
28 28
 }
29 29
 
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/billing/data.php 3 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,8 @@  discard block
 block discarded – undo
77 77
             // if the property useContactAddress is set
78 78
             $billing_data[0]->set_address();
79 79
             return $billing_data[0];
80
-        } catch (midcom_error $e) {
80
+        }
81
+        catch (midcom_error $e) {
81 82
             $e->log();
82 83
             return false;
83 84
         }
@@ -122,10 +123,12 @@  discard block
 block discarded – undo
122 123
     {
123 124
         try {
124 125
             return new org_openpsa_contacts_person_dba($this->linkGuid);
125
-        } catch (midcom_error $e) {
126
+        }
127
+        catch (midcom_error $e) {
126 128
             try {
127 129
                 return new org_openpsa_contacts_group_dba($this->linkGuid);
128
-            } catch (midcom_error $e) {
130
+            }
131
+            catch (midcom_error $e) {
129 132
                 debug_add("Failed to load contact with GUID: " . $this->linkGuid . " - last error:" . $e->getMessage(), MIDCOM_LOG_ERROR);
130 133
                 return false;
131 134
             }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     public static function get_by_object(org_openpsa_invoices_interfaces_customer $object)
42 42
     {
43 43
         if (   !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer))
44
-               // check if the customerContact is set and has invoice_data
44
+                // check if the customerContact is set and has invoice_data
45 45
             && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) {
46 46
             $bd = new org_openpsa_invoices_billing_data_dba();
47 47
             $due = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('default_due_days');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      */
41 41
     public static function get_by_object(org_openpsa_invoices_interfaces_customer $object)
42 42
     {
43
-        if (   !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer))
43
+        if (!($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer))
44 44
                // check if the customerContact is set and has invoice_data
45 45
             && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) {
46 46
             $bd = new org_openpsa_invoices_billing_data_dba();
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/invoice/action.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
         try {
49 49
             $pdf_helper->render_and_attach();
50 50
             return $this->reply(true, $this->_l10n->get('pdf created'));
51
-        } catch (midcom_error $e) {
51
+        }
52
+        catch (midcom_error $e) {
52 53
             return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage());
53 54
         }
54 55
     }
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/event/member.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,8 @@
 block discarded – undo
152 152
                 debug_add('person #' . $person->id . 'has no email address, aborting');
153 153
                 return false;
154 154
             }
155
-        } catch (midcom_error $e) {
155
+        }
156
+        catch (midcom_error $e) {
156 157
             return false;
157 158
         }
158 159
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             $event = new org_openpsa_calendar_event_dba($this->eid);
70 70
         }
71 71
 
72
-        if (    $recipient->id == midcom_connection::get_user()
72
+        if ($recipient->id == midcom_connection::get_user()
73 73
              && !$event->send_notify_me) {
74 74
             //Do not send notification to current user
75 75
             debug_add('event->send_notify_me is false and recipient is current user, aborting notify');
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 return false;
115 115
         }
116 116
 
117
-        if (   $type == 'cancel'
117
+        if ($type == 'cancel'
118 118
             || $type == 'remove') {
119 119
             // TODO: Create iCal export with correct delete commands
120 120
         } else {
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
             $workday_starts = 8;
207 207
             $workday_ends = 16;
208 208
 
209
-            $workday_starts_ts = mktime($workday_starts, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
210
-            $workday_ends_ts = mktime($workday_ends, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
209
+            $workday_starts_ts = mktime($workday_starts, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
210
+            $workday_ends_ts = mktime($workday_ends, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
211 211
             $last_end_time = false;
212 212
             $last_event = false;
213 213
             foreach ($events as $event) {
214
-                if (   $event->end <= $workday_starts_ts
214
+                if ($event->end <= $workday_starts_ts
215 215
                     || $event->start >= $workday_ends_ts) {
216 216
                     // We need not to consider this event, it is outside the defined workday
217 217
                     continue;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             if ($last_end_time === false) {
242 242
                 $last_end_time = $workday_starts_ts;
243 243
             }
244
-            if (   $last_end_time < $workday_ends_ts
244
+            if ($last_end_time < $workday_ends_ts
245 245
                 && (($workday_ends_ts - $last_end_time) >= $amount)) {
246 246
                 $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event);
247 247
             }
Please login to merge, or discard this patch.
lib/net/nehmer/blog/handler/index.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $data['page_title'] = $this->_topic->extra;
63 63
 
64 64
         // Filter by categories
65
-        if (   $handler_id == 'index-category'
65
+        if ($handler_id == 'index-category'
66 66
             || $handler_id == 'latest-category') {
67 67
             $data['category'] = trim(strip_tags($args[0]));
68 68
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         midcom::get()->head->set_pagetitle($this->_request_data['page_title']);
112 112
 
113 113
         // Activate correct leaf
114
-        if (   $this->_config->get('show_navigation_pseudo_leaves')
114
+        if ($this->_config->get('show_navigation_pseudo_leaves')
115 115
             && in_array($this->_request_data['category'], $this->_request_data['categories'])) {
116 116
             $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->_request_data['category']);
117 117
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,7 +141,8 @@  discard block
 block discarded – undo
141 141
             foreach ($this->_articles as $article_counter => $article) {
142 142
                 try {
143 143
                     $data['datamanager']->set_storage($article);
144
-                } catch (midcom_error $e) {
144
+                }
145
+                catch (midcom_error $e) {
145 146
                     $e->log();
146 147
                     continue;
147 148
                 }
@@ -178,7 +179,8 @@  discard block
 block discarded – undo
178 179
         if ($this->_config->get('comments_topic')) {
179 180
             try {
180 181
                 $comments_topic = new midcom_db_topic($this->_config->get('comments_topic'));
181
-            } catch (midcom_error $e) {
182
+            }
183
+            catch (midcom_error $e) {
182 184
                 return false;
183 185
             }
184 186
 
Please login to merge, or discard this patch.