Failed Conditions
Pull Request — master (#1851)
by Struan
35:22
created
www/includes/easyparliament/templates/html/mp/votes_svg.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
     <text font-size="24" font-weight="normal" fill="#000000">
45 45
         <?php foreach ($lines as $j => $line) { ?>
46 46
             <tspan x="40" y="<?= $stance_y + $stance_padding_top + $stance_baseline_offset + ($stance_lineheight * $j) ?>"><?php
47
-               if (strpos($line, '*') !== false) {
48
-                   echo preg_replace(
49
-                       '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i',
50
-                       '$1',
51
-                       $line
52
-                   );
53
-               } else {
54
-                   echo $line;
55
-               }
47
+                if (strpos($line, '*') !== false) {
48
+                    echo preg_replace(
49
+                        '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i',
50
+                        '$1',
51
+                        $line
52
+                    );
53
+                } else {
54
+                    echo $line;
55
+                }
56 56
             ?></tspan>
57 57
         <?php } ?>
58 58
     </text>
Please login to merge, or discard this patch.
www/includes/easyparliament/commentreportlist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $data = [];
98 98
         foreach ($q as $row) {
99
-            $data[] =  [
99
+            $data[] = [
100 100
                 'report_id'		=> $row['report_id'],
101 101
                 'comment_id' 	=> $row['comment_id'],
102 102
                 'firstname'		=> $row['firstname'],
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             ];
108 108
         }
109 109
         foreach ($r as $row) {
110
-            $data[] =  [
110
+            $data[] = [
111 111
                 'report_id'		=> $row['report_id'],
112 112
                 'comment_id' 	=> $row['comment_id'],
113 113
                 'firstname'		=> $row['firstname'],
Please login to merge, or discard this patch.
www/includes/easyparliament/member.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         # All the following only happen if the house to display isn't yet set.
88 88
         # TODO: This relies on interpreting the default value of 0 as a false, which may be error-prone.
89
-        if (! (bool) $this->house_disp) {
89
+        if (!(bool) $this->house_disp) {
90 90
             if ($house == HOUSE_TYPE_LONDON_ASSEMBLY # London Assembly
91 91
                 || $house == HOUSE_TYPE_SCOTLAND     # MSPs and
92 92
                 || $house == HOUSE_TYPE_WALES        # MSs and
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             $policiesList = new Policies($policyID);
252 252
         }
253 253
         $rel_agreements = $policiesList->all_policy_agreements[$policyID] ?? [];
254
-        $rel_agreements = array_filter($rel_agreements, function ($agreement) use ($house) {
254
+        $rel_agreements = array_filter($rel_agreements, function($agreement) use ($house) {
255 255
             return $this->date_in_memberships($house, $agreement['date']);
256 256
         });
257 257
         return $rel_agreements;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         }
527 527
 
528 528
         if ($display && array_key_exists('register_member_interests_html', $this->extra_info) && ($this->extra_info['register_member_interests_html'] != '')) {
529
-            $args =  [
529
+            $args = [
530 530
                 "sort" => "regexp_replace",
531 531
             ];
532 532
             $GLOSSARY = new GLOSSARY($args);
Please login to merge, or discard this patch.
www/includes/easyparliament/glossary.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 include_once INCLUDESPATH . "easyparliament/searchengine.php";
25 25
 
26 26
 class GLOSSARY {
27
-    public $num_terms;			// how many glossary entries do we have
27
+    public $num_terms; // how many glossary entries do we have
28 28
     // (changes depending on how GLOSSARY is called
29
-    public $hansard_count;		// how many times does the phrase appear in hansard?
30
-    public $query;				// search term
31
-    public $glossary_id;		// if this is set then we only have 1 glossary term
32
-    public $current_term;		// will only be set if we have a valid epobject_id
29
+    public $hansard_count; // how many times does the phrase appear in hansard?
30
+    public $query; // search term
31
+    public $glossary_id; // if this is set then we only have 1 glossary term
32
+    public $current_term; // will only be set if we have a valid epobject_id
33 33
     public $current_letter;
34 34
 
35 35
     // constructor...
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         // These stop stupid submissions.
74 74
         // everything should be lowercase.
75
-        $this->stopwords = [ "the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate" ];
75
+        $this->stopwords = ["the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate"];
76 76
 
77 77
     }
78 78
 
Please login to merge, or discard this patch.
www/includes/dbtypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@
 block discarded – undo
158 158
 ];
159 159
 $hansardmajors[104] = $hansardmajors[4];
160 160
 
161
-$parties =  [
161
+$parties = [
162 162
     'Bp'    => 'Bishop',
163 163
     'Con'   => 'Conservative',
164 164
     'CWM'   => 'Deputy Speaker',
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/alert/_mp_alert_form.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php if (isset($constituencies) && count($constituencies) > 0) {
2
-  $member_options = true; ?>
2
+    $member_options = true; ?>
3 3
   <h3><?= sprintf(gettext('Sign up for alerts when Representatives for constituencies matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3>
4 4
   <ul>
5 5
     <?php foreach ($constituencies as $constituency => $member) { ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/alert/index.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
       <?php } elseif ($step !== '') { ?>
131 131
         <?php include '_alert_form.php';
132 132
       } elseif ($this_step == '') {
133
-          if(
133
+          if (
134 134
               !$results && (
135 135
                 $members ||
136 136
                 (isset($constituencies) && count($constituencies) > 0) ||
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
           </div>
130 130
       <?php } elseif ($step !== '') { ?>
131 131
         <?php include '_alert_form.php';
132
-      } elseif ($this_step == '') {
133
-          if(
134
-              !$results && (
132
+        } elseif ($this_step == '') {
133
+            if(
134
+                !$results && (
135 135
                 $members ||
136 136
                 (isset($constituencies) && count($constituencies) > 0) ||
137 137
                 ($alertsearch)
138
-              )
139
-          ) {
140
-              /* We need to disambiguate the user's instructions */
141
-              $member_options = false;
142
-              ?>
138
+                )
139
+            ) {
140
+                /* We need to disambiguate the user's instructions */
141
+                $member_options = false;
142
+                ?>
143 143
         <div class="alert-section alert-section--disambiguation">
144 144
             <div class="alert-section__primary">
145 145
 
146 146
               <?php if ($members) {
147
-                  $member_options = true; ?>
147
+                    $member_options = true; ?>
148 148
                 <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3>
149 149
                 <ul>
150 150
                   <?php
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                             <input type="hidden" name="pid" value="<?= $row['person_id'] ?>">
158 158
                             <input type="hidden" name="ignore_speaker_votes" value="<?= $ignore_speaker_votes ?>">
159 159
                             <?php
160
-                                  $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']);
160
+                                    $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']);
161 161
                         if ($row['constituency']) {
162 162
                             $name .= ' (' . gettext($row['constituency']) . ')';
163 163
                         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
               <?php } ?>
172 172
 
173 173
               <?php if (isset($constituencies) && count($constituencies) > 0) {
174
-                  $member_options = true; ?>
174
+                    $member_options = true; ?>
175 175
                 <h3><?= sprintf(gettext('Sign up for alerts when MPs for constituencies matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3>
176 176
                 <ul>
177 177
                 <?php foreach ($constituencies as $constituency => $member) { ?>
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
               <?php } ?>
190 190
 
191 191
               <?php if ($alertsearch) {
192
-                  if (!$member_options) { ?>
192
+                    if (!$member_options) { ?>
193 193
                 <h3><?= gettext('That doesn’t match a person, postcode or constituency. Search again to refine your email alert.') ?></h3>
194 194
                 <ul>
195 195
                     <?php if (isset($mistakes['postcode_and'])) { ?>
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
                             want? You will only get an alert if all of these
201 201
                             are mentioned in the same debate.') ?>
202 202
                           <?php if (isset($member_alertsearch)) {
203
-                              printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…'));
204
-                          } ?>
203
+                                printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…'));
204
+                            } ?>
205 205
                         </em>
206 206
                     </li>
207 207
                     <?php } ?>
Please login to merge, or discard this patch.
classes/AlertView/Standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@
 block discarded – undo
350 350
             $members_from_names = [];
351 351
             $names_from_pids = array_values(\MySociety\TheyWorkForYou\Utility\Search::speakerNamesForIDs($text));
352 352
             foreach ($names_from_pids as $name) {
353
-                $members_from_names = array_merge($members_from_names,\MySociety\TheyWorkForYou\Utility\Search::searchMemberDbLookupWithNames($name));
353
+                $members_from_names = array_merge($members_from_names, \MySociety\TheyWorkForYou\Utility\Search::searchMemberDbLookupWithNames($name));
354 354
             }
355 355
             $members_from_words = \MySociety\TheyWorkForYou\Utility\Search::searchMemberDbLookupWithNames($text, true);
356 356
             $this->data['members'] = array_merge($members_from_words, $members_from_names);
Please login to merge, or discard this patch.
classes/Utility/Alert.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 
106 106
                 # and then create an array with the words and phrases
107 107
                 $criteria = [];
108
-                if ( $alert_criteria != "") {
108
+                if ($alert_criteria != "") {
109 109
                     $criteria = explode(' ', $alert_criteria);
110 110
                 }
111 111
                 $criteria = array_merge($criteria, $phrases[1]);
Please login to merge, or discard this patch.