Completed
Branch master (4f76a2)
by Andreas
22:32
created
lib/midcom/helper/toolbar/node.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,8 @@
 block discarded – undo
88 88
                         $style = midcom_db_style::get_cached($style_id);
89 89
                         $styleeditor_url = midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$style->guid}/";
90 90
                         $enabled = true;
91
-                    } catch (midcom_error $e) {
91
+                    }
92
+                    catch (midcom_error $e) {
92 93
                         $e->log();
93 94
                     }
94 95
                 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
         $buttons = [];
58 58
         $workflow = new midcom\workflow\datamanager;
59
-        if (   $this->topic->can_do('midgard:update')
59
+        if ($this->topic->can_do('midgard:update')
60 60
             && $this->topic->can_do('midcom.admin.folder:topic_management')) {
61 61
             $buttons[] = $workflow->get_button("__ais/folder/edit/", [
62 62
                 MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             ]);
69 69
         }
70 70
 
71
-        if (   $urltopic->can_do('midgard:update')
71
+        if ($urltopic->can_do('midgard:update')
72 72
             && $urltopic->can_do('midcom.admin.folder:topic_management')) {
73 73
             // Allow to move other than root folder
74 74
             if ($urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid')) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             }
81 81
         }
82 82
 
83
-        if (   $this->topic->can_do('midgard:update')
83
+        if ($this->topic->can_do('midgard:update')
84 84
             && $this->topic->can_do('midcom.admin.folder:topic_management')) {
85 85
             $viewer = new midcom\workflow\viewer;
86 86
             $buttons[] = $viewer->get_button("__ais/folder/order/", [
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             ];
98 98
         }
99 99
         $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false));
100
-        if (   $this->topic->can_do('midcom.admin.folder:template_management')
100
+        if ($this->topic->can_do('midcom.admin.folder:template_management')
101 101
             && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) {
102 102
             $enabled = false;
103 103
             $styleeditor_url = '';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             ];
123 123
         }
124 124
 
125
-        if (   $this->topic->can_do('midgard:create')
125
+        if ($this->topic->can_do('midgard:create')
126 126
             && $this->topic->can_do('midcom.admin.folder:topic_management')) {
127 127
             $buttons[] = $workflow->get_button("__ais/folder/create/", [
128 128
                 MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('create subfolder', 'midcom.admin.folder'),
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 MIDCOM_TOOLBAR_ACCESSKEY => 'f',
131 131
             ]);
132 132
         }
133
-        if (   $urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid')
133
+        if ($urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid')
134 134
             && $urltopic->can_do('midgard:delete')
135 135
             && $urltopic->can_do('midcom.admin.folder:topic_management')) {
136 136
             $workflow = new midcom\workflow\delete(['object' => $urltopic, 'recursive' => true]);
Please login to merge, or discard this patch.
lib/midcom/style/midcom_helper_datamanager2_unlock.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,8 @@
 block discarded – undo
4 4
 try {
5 5
     $person = new midcom_db_person($metadata->locker);
6 6
     $name = $person->name;
7
-} catch (midcom_error $e) {
7
+}
8
+catch (midcom_error $e) {
8 9
     $name = $this->data['handler']->_l10n_midcom->get('unknown user');
9 10
     $e->log();
10 11
 }
Please login to merge, or discard this patch.
lib/midcom/exec/touch_attachments.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@
 block discarded – undo
16 16
 foreach ($atts as $att) {
17 17
     try {
18 18
         $att->file_to_cache();
19
-    } catch (midcom_error $e) {
19
+    }
20
+    catch (midcom_error $e) {
20 21
         echo 'Error: ' . $e->getMessage() . "\n";
21 22
     }
22 23
 }
Please login to merge, or discard this patch.
lib/midcom/exec/reindex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
 $http_client = new org_openpsa_httplib();
57 57
 $http_client->set_param('timeout', 300);
58
-if (   !empty($_SERVER['PHP_AUTH_USER'])
58
+if (!empty($_SERVER['PHP_AUTH_USER'])
59 59
     && !empty($_SERVER['PHP_AUTH_PW'])) {
60 60
     $http_client->basicauth['user'] = $_SERVER['PHP_AUTH_USER'];
61 61
     $http_client->basicauth['password'] = $_SERVER['PHP_AUTH_PW'];
Please login to merge, or discard this patch.
lib/midcom/services/indexer/document.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
     {
464 464
         // Complete fields
465 465
         $this->indexed = time();
466
-        if (   $this->author == ''
466
+        if ($this->author == ''
467 467
             && isset($this->creator->name)) {
468 468
             $this->author = $this->creator->name;
469 469
         }
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     public function read_metadata_from_object($object)
607 607
     {
608 608
         // Published is set to non-empty value, use it as creation data
609
-        if (   !empty($object->metadata->published)
609
+        if (!empty($object->metadata->published)
610 610
             && !preg_match('/0{1,4}-0{1,2}0{1,2}\s+0{1,2}:0{1,2}:0{1,2}/', $object->metadata->published)) {
611 611
             $this->created = $this->read_unixtime($object->metadata->published);
612 612
         } elseif (isset($object->metadata->created)) {
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
             return @strtotime($stamp);
646 646
         }
647 647
         // Unix timestamp
648
-        return (int)$stamp;
648
+        return (int) $stamp;
649 649
     }
650 650
 
651 651
     /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -680,7 +680,8 @@
 block discarded – undo
680 680
     {
681 681
         try {
682 682
             return midcom_db_person::get_cached($id);
683
-        } catch (midcom_error $e) {
683
+        }
684
+        catch (midcom_error $e) {
684 685
             return false;
685 686
         }
686 687
     }
Please login to merge, or discard this patch.
lib/net/nemein/wiki/parser.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,8 @@
 block discarded – undo
63 63
 
64 64
         try {
65 65
             $attachment = new midcom_db_attachment($guid);
66
-        } catch (midcom_error $e) {
66
+        }
67
+        catch (midcom_error $e) {
67 68
             $e->log();
68 69
             return "<span class=\"missing_photo\" title=\"{$guid}\">{$fulltag}</span>{$after}";
69 70
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                 return $this->render_link($parts[1], $parts[2]) . $after;
224 224
 
225 225
             // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
226
-            case (   preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
226
+            case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
227 227
                   && method_exists($this, "_run_macro_{$macro_parts[1]}")):
228 228
                 $method = "_run_macro_{$macro_parts[1]}";
229 229
                 return $this->$method($macro_parts[2], $match[0], $after);
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                 $folder = $wikipage_match['latest_parent'];
257 257
             }
258 258
 
259
-            if (   isset($folder[MIDCOM_NAV_OBJECT])
259
+            if (isset($folder[MIDCOM_NAV_OBJECT])
260 260
                 && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) {
261 261
                 $workflow = $this->get_workflow('datamanager');
262 262
                 return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>";
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                     $links[$parts[1]] = $parts[2];
292 292
                 }
293 293
                 // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
294
-                elseif (   !preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
294
+                elseif (!preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
295 295
                         || !method_exists($this, "_run_macro_{$macro_parts[1]}")) {
296 296
                     // MediaWiki-style link [wikipage] (no text)
297 297
                     $links[$fulltext] = $fulltext;
Please login to merge, or discard this patch.
lib/net/nehmer/static/navigation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $qb->add_constraint('name', '<>', '');
47 47
 
48 48
         // Unless in Auto-Index mode or the index article is hidden, we skip the index article.
49
-        if (   !$this->_config->get('autoindex')
49
+        if (!$this->_config->get('autoindex')
50 50
             && !$this->_config->get('indexinnav')) {
51 51
             $qb->add_constraint('name', '<>', 'index');
52 52
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/mnrelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
         $qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']);
100 100
         $qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key());
101 101
 
102
-        if (   $this->config['type_config']['sortable']
102
+        if ($this->config['type_config']['sortable']
103 103
             && preg_match('/^(ASC|DESC)/i', $this->config['type_config']['sortable_sort_order'], $regs)) {
104 104
             $order = strtoupper($regs[1]);
105 105
             $qb->add_order('metadata.score', $order);
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/duplicates/person.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,8 @@  discard block
 block discarded – undo
66 66
             try {
67 67
                 $person1 = new org_openpsa_contacts_person_dba($param->parentguid);
68 68
                 $person2 = new org_openpsa_contacts_person_dba($param->name);
69
-            } catch (midcom_error $e) {
69
+            }
70
+            catch (midcom_error $e) {
70 71
                 $i++;
71 72
                 continue;
72 73
             }
@@ -137,7 +138,8 @@  discard block
 block discarded – undo
137 138
                 try {
138 139
                     $merger = new org_openpsa_contacts_duplicates_merge('person', $this->_config);
139 140
                     $merger->merge_delete($person1, $person2);
140
-                } catch (midcom_error $e) {
141
+                }
142
+                catch (midcom_error $e) {
141 143
                     // TODO: Localize
142 144
                     midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), 'Merge failed, errstr: ' . $e->getMessage(), 'error');
143 145
                 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     private function load_next()
42 42
     {
43
-        $i =& $this->_request_data['loop_i'];
43
+        $i = & $this->_request_data['loop_i'];
44 44
         while ($i < 100) {
45 45
             debug_add("Loop iteration {$i}");
46 46
             $qb = new midgard_query_builder('midgard_parameter');
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 continue;
69 69
             }
70 70
             // Make sure we actually have enough rights to do this
71
-            if (   !$person1->can_do('midgard:update')
71
+            if (!$person1->can_do('midgard:update')
72 72
                 || !$person1->can_do('midgard:delete')
73 73
                 || !$person2->can_do('midgard:update')
74 74
                 || !$person2->can_do('midgard:delete')) {
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
                 continue;
78 78
             }
79 79
             // Extra sanity check (in case of semi-successful not-duplicate mark)
80
-            if (   $person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid)
80
+            if ($person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid)
81 81
                 || $person2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person1->guid)) {
82 82
                 debug_add("It seems these two (#{$person1->id} and #{$person2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN);
83 83
                 $i++;
84 84
                 continue;
85 85
             }
86 86
 
87
-            $this->_request_data['probability'] = (float)$param->value;
87
+            $this->_request_data['probability'] = (float) $param->value;
88 88
             $this->_request_data['person1'] = $person1;
89 89
             $this->_request_data['person2'] = $person2;
90 90
             break;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if ($keep == 'both') {
103 103
                 $option1->require_do('midgard:update');
104 104
                 $option2->require_do('midgard:update');
105
-                if (   $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
105
+                if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
106 106
                     && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) {
107 107
                     // Clear the possible duplicate parameters
108 108
                     $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid);
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
                 }
121 121
             } else {
122 122
                 if ($keep == $option1->guid) {
123
-                    $person1 =& $option1;
124
-                    $person2 =& $option2;
123
+                    $person1 = & $option1;
124
+                    $person2 = & $option2;
125 125
                 } elseif ($keep == $option2->guid) {
126
-                    $person1 =& $option2;
127
-                    $person2 =& $option1;
126
+                    $person1 = & $option2;
127
+                    $person2 = & $option1;
128 128
                 } else {
129 129
                     throw new midcom_error('Something weird happened (basically we got bogus data)');
130 130
                 }
Please login to merge, or discard this patch.