Passed
Branch master (f83f0c)
by Andreas
17:25
created
lib/net/nehmer/blog/navigation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         // Hide the articles that have the publish time in the future and if
43 43
         // the user is not administrator
44
-        if (   $this->_config->get('enable_scheduled_publishing')
44
+        if ($this->_config->get('enable_scheduled_publishing')
45 45
             && !midcom::get()->auth->admin) {
46 46
             // Show the article only if the publishing time has passed or the viewer
47 47
             // is the author
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 
84 84
     private function _add_pseudo_leaves(array &$leaves)
85 85
     {
86
-        if (   $this->_config->get('archive_enable')
86
+        if ($this->_config->get('archive_enable')
87 87
             && $this->_config->get('archive_in_navigation')) {
88 88
             $leaves["{$this->_topic->id}_ARCHIVE"] = [
89 89
                 MIDCOM_NAV_URL => "archive/",
90 90
                 MIDCOM_NAV_NAME => $this->_l10n->get('archive'),
91 91
             ];
92 92
         }
93
-        if (   $this->_config->get('rss_enable')
93
+        if ($this->_config->get('rss_enable')
94 94
             && $this->_config->get('feeds_in_navigation')) {
95 95
             $leaves[self::LEAFID_FEEDS] = [
96 96
                 MIDCOM_NAV_URL => "feeds/",
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             ];
99 99
         }
100 100
 
101
-        if (   $this->_config->get('categories_in_navigation')
101
+        if ($this->_config->get('categories_in_navigation')
102 102
             && $this->_config->get('categories') != '') {
103 103
             $categories = explode(',', $this->_config->get('categories'));
104 104
             foreach ($categories as $category) {
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
             }
110 110
         }
111 111
 
112
-        if (   $this->_config->get('archive_years_in_navigation')
112
+        if ($this->_config->get('archive_years_in_navigation')
113 113
             && $this->_config->get('archive_years_enable')) {
114 114
             $qb = midcom_db_article::new_query_builder();
115 115
             $qb->add_constraint('topic', '=', $this->_topic->id);
116 116
 
117 117
             // Hide the articles that have the publish time in the future and if
118 118
             // the user is not administrator
119
-            if (   $this->_config->get('enable_scheduled_publishing')
119
+            if ($this->_config->get('enable_scheduled_publishing')
120 120
                 && !midcom::get()->auth->admin) {
121 121
                 // Show the article only if the publishing time has passed or the viewer
122 122
                 // is the author
Please login to merge, or discard this patch.
lib/net/nehmer/static/viewer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             }
74 74
         }
75 75
 
76
-        if (   $this->_topic->can_do('midgard:update')
76
+        if ($this->_topic->can_do('midgard:update')
77 77
             && $this->_topic->can_do('midcom:component_config')) {
78 78
             $buttons[] = $workflow->get_button('config/', [
79 79
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),
Please login to merge, or discard this patch.
lib/net/nehmer/comments/handler/moderate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $this->load_comment($args[0], false);
40 40
         $moderators = $this->_config->get('moderators');
41
-        if (   $this->_comment->report_abuse()
41
+        if ($this->_comment->report_abuse()
42 42
             && $moderators) {
43 43
             // Prepare notification message
44 44
             $message = [];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             $message['content'] = '';
47 47
             $logs = $this->_comment->get_logs();
48 48
             if (count($logs) > 0) {
49
-                $message['content'] .= $this->_l10n->get('moderation history').":\n\n";
49
+                $message['content'] .= $this->_l10n->get('moderation history') . ":\n\n";
50 50
                 foreach ($logs as $time => $log) {
51 51
                     $reported = $this->_l10n->get_formatter()->datetime(strtotime("{$time}Z"));
52 52
                     $message['content'] .= $this->_l10n->get(sprintf('%s: %s by %s (from %s)', "$reported:\n", $this->_l10n->get($log['action']), $log['reporter'], $log['ip'])) . "\n\n";
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $this->_comment = new net_nehmer_comments_comment($identifier);
120 120
 
121 121
         if (!$this->_comment->can_do('midgard:update')) {
122
-            $this->_comment->_sudo_requested = midcom::get()->auth->request_sudo('net.nehmer.comments');;
122
+            $this->_comment->_sudo_requested = midcom::get()->auth->request_sudo('net.nehmer.comments'); ;
123 123
         }
124 124
         if ($require_moderation_privilege) {
125 125
             $this->_comment->require_do('net.nehmer.comments:moderation');
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/stylehelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __construct(array &$data)
24 24
     {
25
-        $this->_data =& $data;
25
+        $this->_data = & $data;
26 26
         midcom::get()->head->enable_jquery_ui(['accordion']);
27 27
     }
28 28
 
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
             return;
34 34
         }
35 35
 
36
-        if (   midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style')
37
-            && (   $this->_data['handler_id'] !== '____mfa-asgard-object_create'
36
+        if (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style')
37
+            && ($this->_data['handler_id'] !== '____mfa-asgard-object_create'
38 38
                 || $this->_data['current_type'] == 'midgard_element')) {
39 39
             $help_element = $this->_get_help_style_elementnames($this->_data['object']);
40
-        } elseif (   midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element')
40
+        } elseif (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element')
41 41
                   && $this->_data['handler_id'] !== '____mfa-asgard-object_create') {
42 42
             $help_element = $this->_get_help_element();
43 43
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     private function _get_help_element()
51 51
     {
52
-        if (   empty($this->_data['object']->name)
52
+        if (empty($this->_data['object']->name)
53 53
             || empty($this->_data['object']->style)) {
54 54
             // We cannot help with empty elements
55 55
             return;
Please login to merge, or discard this patch.
lib/midcom/services/auth/acl.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
         $cache_id = $user_id . '::' . $object_guid;
522 522
 
523 523
         if (!array_key_exists($cache_id, self::$_privileges_cache)) {
524
-            if (   empty($object_guid)
524
+            if (empty($object_guid)
525 525
                 || empty($object_class)) {
526 526
                 /* No idea if there should be some special log message written */
527 527
                 return [];
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
         // otherwise. (get_parent_data calling get_object_by_guid calling can_do ...)
622 622
         list ($parent_guid, $parent_class) = $this->get_parent_data($guid, $class);
623 623
 
624
-        if (   $parent_guid == $guid
624
+        if ($parent_guid == $guid
625 625
             || !mgd_is_guid($parent_guid)) {
626 626
             $base_privileges = [];
627 627
         } else {
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         // Determine parent ownership
633 633
         $is_owner = false;
634 634
         $last_owner_scope = -1;
635
-        if (   array_key_exists('midgard:owner', $base_privileges)
635
+        if (array_key_exists('midgard:owner', $base_privileges)
636 636
             && $base_privileges['midgard:owner'] == MIDCOM_PRIVILEGE_ALLOW) {
637 637
             $is_owner = true;
638 638
         }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 
673 673
             $valid_privileges[$scope][$privilege->privilegename] = $privilege->value;
674 674
 
675
-            if (   $privilege->privilegename == 'midgard:owner'
675
+            if ($privilege->privilegename == 'midgard:owner'
676 676
                 && $scope > $last_owner_scope) {
677 677
                 $is_owner = ($privilege->value == MIDCOM_PRIVILEGE_ALLOW);
678 678
                 $last_owner_scope = $scope;
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
         $content_privilege = null;
870 870
 
871 871
         foreach ($object_privileges as $privilege) {
872
-            if (   $privilege->privilegename != $privilegename
872
+            if ($privilege->privilegename != $privilegename
873 873
                 ||  $privilege->scope <= $last_scope
874 874
                 || !$privilege->does_privilege_apply($user_id)) {
875 875
                 continue;
@@ -880,10 +880,10 @@  discard block
 block discarded – undo
880 880
         }
881 881
 
882 882
         //owner privileges override everything but person privileges, so we have to cross-check those here
883
-        if (   $privilegename != 'midgard:owner'
883
+        if ($privilegename != 'midgard:owner'
884 884
             && $last_scope < MIDCOM_PRIVILEGE_SCOPE_OWNER) {
885 885
             $owner_privileges = $this->get_owner_default_privileges();
886
-            if (    array_key_exists($privilegename, $owner_privileges)
886
+            if (array_key_exists($privilegename, $owner_privileges)
887 887
                  && $this->_load_content_privilege('midgard:owner', $guid, $class, $user_id)
888 888
                  && self::$_content_privileges_cache[$cache_id]['midgard:owner']) {
889 889
                 self::$_content_privileges_cache[$cache_id][$privilegename] = ($owner_privileges[$privilegename] == MIDCOM_PRIVILEGE_ALLOW);
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
         //if nothing was found, we try to recurse to parent
900 900
         list ($parent_guid, $parent_class) = $this->get_parent_data($guid, $class);
901 901
 
902
-        if (   $parent_guid == $guid
902
+        if ($parent_guid == $guid
903 903
             || !mgd_is_guid($parent_guid)) {
904 904
             return false;
905 905
         }
Please login to merge, or discard this patch.
lib/midcom/cron/purgedeleted.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     {
31 31
         $classes = [];
32 32
         foreach (midcom_connection::get_schema_types() as $mgdschema) {
33
-            if (   substr($mgdschema, 0, 2) == '__'
33
+            if (substr($mgdschema, 0, 2) == '__'
34 34
                 || !midgard_reflector_object::has_metadata_class($mgdschema)) {
35 35
                 continue;
36 36
             }
Please login to merge, or discard this patch.
lib/midcom/config/test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 class midcom_config_test
15 15
 {
16 16
     const OK = 0;
17
-    const WARNING =  1;
17
+    const WARNING = 1;
18 18
     const ERROR = 2;
19 19
 
20 20
     private $messages = [
Please login to merge, or discard this patch.
lib/midcom/admin/folder/handler/order.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         }
90 90
 
91 91
         // Approve if possible
92
-        if (   $approval_status
92
+        if ($approval_status
93 93
             && $object->can_do('midcom:approve')) {
94 94
             $object->metadata->approve();
95 95
         }
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
             // jQuery sorting
136 136
             midcom::get()->head->enable_jquery_ui(['mouse', 'sortable']);
137 137
 
138
-            midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL.'/midcom.admin.folder/jquery-postfix.js');
138
+            midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.folder/jquery-postfix.js');
139 139
 
140 140
             // Custom styles
141
-            $this->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.admin.folder/midcom-admin-order.css');
141
+            $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.folder/midcom-admin-order.css');
142 142
         }
143 143
     }
144 144
 
Please login to merge, or discard this patch.
lib/midcom/helper/imagefilter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             debug_add("The File {$filename} is not writeable.", MIDCOM_LOG_ERROR);
192 192
             return false;
193 193
         }
194
-        if (   !empty($this->_filename)
194
+        if (!empty($this->_filename)
195 195
             && $this->_filename !== $filename) {
196 196
             $this->_tmpfiles[] = $this->_filename;
197 197
         }
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         $tmpfile = null;
417 417
         $imagesize = getimagesize($this->_filename);
418 418
 
419
-        if (   $imagesize[2] == IMAGETYPE_JPEG
419
+        if ($imagesize[2] == IMAGETYPE_JPEG
420 420
             && $this->_jpegtran_available()) {
421 421
             /* jpegtran */
422 422
             $operations = [
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
         while ($rotate > 360) {
476 476
             $rotate -= 360;
477 477
         }
478
-        if (   $rotate == 0
478
+        if ($rotate == 0
479 479
             || $rotate == 360) {
480 480
             debug_add("Rotate is {$rotate}, we're happy as-is.");
481 481
             return;
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         $imagesize = getimagesize($this->_filename);
486 486
 
487 487
         // Try lossless jpegtran rotation if possible
488
-        if (   $imagesize[2] == IMAGETYPE_JPEG
488
+        if ($imagesize[2] == IMAGETYPE_JPEG
489 489
             && ($rotate % 90 == 0)
490 490
             && $this->_jpegtran_available()) {
491 491
             $tmpfile = $this->_get_tempfile();
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
      */
615 615
     public function fill($x = null, $y = null, $color = null, $gravity = 'center')
616 616
     {
617
-        if (   empty($x)
617
+        if (empty($x)
618 618
             || empty($y)
619 619
             || empty($color)) {
620 620
             //This is a bit silly, but here for backwards compatibility...
Please login to merge, or discard this patch.