Test Failed
Push — main ( a7121c...c8394f )
by Rafael
91:23
created
public/htdocs/includes/geoPHP/lib/adapters/GeoHash.class.php 1 patch
Braces   +53 added lines, -11 removed lines patch added patch discarded remove patch
@@ -98,7 +98,9 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function write(Geometry $geometry, $precision = null)
100 100
     {
101
-        if ($geometry->isEmpty()) return '';
101
+        if ($geometry->isEmpty()) {
102
+            return '';
103
+        }
102 104
 
103 105
         if ($geometry->geometryType() === 'Point') {
104 106
             return $this->encodePoint($geometry, $precision);
@@ -197,19 +199,59 @@  discard block
 block discarded – undo
197 199
         for ($i = 0,$c = strlen($hash);$i < $c;$i++) {
198 200
             $v = strpos($this->table, $hash[$i]);
199 201
             if (1 & $i) {
200
-                if (16 & $v)$minlat = ($minlat + $maxlat) / 2; else $maxlat = ($minlat + $maxlat) / 2;
201
-                if (8 & $v) $minlon = ($minlon + $maxlon) / 2; else $maxlon = ($minlon + $maxlon) / 2;
202
-                if (4 & $v) $minlat = ($minlat + $maxlat) / 2; else $maxlat = ($minlat + $maxlat) / 2;
203
-                if (2 & $v) $minlon = ($minlon + $maxlon) / 2; else $maxlon = ($minlon + $maxlon) / 2;
204
-                if (1 & $v) $minlat = ($minlat + $maxlat) / 2; else $maxlat = ($minlat + $maxlat) / 2;
202
+                if (16 & $v) {
203
+                    $minlat = ($minlat + $maxlat) / 2;
204
+                } else {
205
+                    $maxlat = ($minlat + $maxlat) / 2;
206
+                }
207
+                if (8 & $v) {
208
+                    $minlon = ($minlon + $maxlon) / 2;
209
+                } else {
210
+                    $maxlon = ($minlon + $maxlon) / 2;
211
+                }
212
+                if (4 & $v) {
213
+                    $minlat = ($minlat + $maxlat) / 2;
214
+                } else {
215
+                    $maxlat = ($minlat + $maxlat) / 2;
216
+                }
217
+                if (2 & $v) {
218
+                    $minlon = ($minlon + $maxlon) / 2;
219
+                } else {
220
+                    $maxlon = ($minlon + $maxlon) / 2;
221
+                }
222
+                if (1 & $v) {
223
+                    $minlat = ($minlat + $maxlat) / 2;
224
+                } else {
225
+                    $maxlat = ($minlat + $maxlat) / 2;
226
+                }
205 227
                 $latE /= 8;
206 228
                 $lonE /= 4;
207 229
             } else {
208
-                if (16 & $v)$minlon = ($minlon + $maxlon) / 2; else $maxlon = ($minlon + $maxlon) / 2;
209
-                if (8 & $v) $minlat = ($minlat + $maxlat) / 2; else $maxlat = ($minlat + $maxlat) / 2;
210
-                if (4 & $v) $minlon = ($minlon + $maxlon) / 2; else $maxlon = ($minlon + $maxlon) / 2;
211
-                if (2 & $v) $minlat = ($minlat + $maxlat) / 2; else $maxlat = ($minlat + $maxlat) / 2;
212
-                if (1 & $v) $minlon = ($minlon + $maxlon) / 2; else $maxlon = ($minlon + $maxlon) / 2;
230
+                if (16 & $v) {
231
+                    $minlon = ($minlon + $maxlon) / 2;
232
+                } else {
233
+                    $maxlon = ($minlon + $maxlon) / 2;
234
+                }
235
+                if (8 & $v) {
236
+                    $minlat = ($minlat + $maxlat) / 2;
237
+                } else {
238
+                    $maxlat = ($minlat + $maxlat) / 2;
239
+                }
240
+                if (4 & $v) {
241
+                    $minlon = ($minlon + $maxlon) / 2;
242
+                } else {
243
+                    $maxlon = ($minlon + $maxlon) / 2;
244
+                }
245
+                if (2 & $v) {
246
+                    $minlat = ($minlat + $maxlat) / 2;
247
+                } else {
248
+                    $maxlat = ($minlat + $maxlat) / 2;
249
+                }
250
+                if (1 & $v) {
251
+                    $minlon = ($minlon + $maxlon) / 2;
252
+                } else {
253
+                    $maxlon = ($minlon + $maxlon) / 2;
254
+                }
213 255
                 $latE /= 4;
214 256
                 $lonE /= 8;
215 257
             }
Please login to merge, or discard this patch.
public/htdocs/includes/geoPHP/geoPHP.inc.php 1 patch
Braces   +38 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@  discard block
 block discarded – undo
54 54
         if (!$type) {
55 55
             // If the user is trying to load a Geometry from a Geometry... Just pass it back
56 56
             if (is_object($data)) {
57
-                if ($data instanceof Geometry) return $data;
57
+                if ($data instanceof Geometry) {
58
+                    return $data;
59
+                }
58 60
             }
59 61
 
60 62
             $detected = geoPHP::detectFormat($data);
@@ -124,7 +126,9 @@  discard block
 block discarded – undo
124 126
     static function geosInstalled($force = null)
125 127
     {
126 128
         static $geos_installed = null;
127
-        if ($force !== null) $geos_installed = $force;
129
+        if ($force !== null) {
130
+            $geos_installed = $force;
131
+        }
128 132
         if ($geos_installed !== null) {
129 133
             return $geos_installed;
130 134
         }
@@ -154,8 +158,12 @@  discard block
 block discarded – undo
154 158
     {
155 159
         // If it's an array of one, then just parse the one
156 160
         if (is_array($geometry)) {
157
-            if (empty($geometry)) return false;
158
-            if (count($geometry) == 1) return geoPHP::geometryReduce(array_shift($geometry));
161
+            if (empty($geometry)) {
162
+                return false;
163
+            }
164
+            if (count($geometry) == 1) {
165
+                return geoPHP::geometryReduce(array_shift($geometry));
166
+            }
159 167
         }
160 168
 
161 169
         // If the geometry cannot even theoretically be reduced more, then pass it back
@@ -233,7 +241,9 @@  discard block
 block discarded – undo
233 241
         $bytes = unpack("c*", fread($mem, 11));
234 242
 
235 243
         // If bytes is empty, then we were passed empty input
236
-        if (empty($bytes)) return false;
244
+        if (empty($bytes)) {
245
+            return false;
246
+        }
237 247
 
238 248
         // First char is a tab, space or carriage-return. trim it and try again
239 249
         if ($bytes[1] == 9 || $bytes[1] == 10 || $bytes[1] == 32) {
@@ -244,8 +254,11 @@  discard block
 block discarded – undo
244 254
         // Detect WKB or EWKB -- first byte is 1 (little endian indicator)
245 255
         if ($bytes[1] == 1) {
246 256
             // If SRID byte is TRUE (1), it's EWKB
247
-            if ($bytes[5]) return 'ewkb';
248
-            else return 'wkb';
257
+            if ($bytes[5]) {
258
+                return 'ewkb';
259
+            } else {
260
+                return 'wkb';
261
+            }
249 262
         }
250 263
 
251 264
         // Detect HEX encoded WKB or EWKB (PostGIS format) -- first byte is 48, second byte is 49 (hex '01' => first-byte = 1)
@@ -278,12 +291,24 @@  discard block
 block discarded – undo
278 291
         if ($bytes[1] == 60) {
279 292
             // grab the first 256 characters
280 293
             $string = substr($input, 0, 256);
281
-            if (strpos($string, '<kml') !== false)        return 'kml';
282
-            if (strpos($string, '<coordinate') !== false) return 'kml';
283
-            if (strpos($string, '<gpx') !== false)        return 'gpx';
284
-            if (strpos($string, '<georss') !== false)     return 'georss';
285
-            if (strpos($string, '<rss') !== false)        return 'georss';
286
-            if (strpos($string, '<feed') !== false)       return 'georss';
294
+            if (strpos($string, '<kml') !== false) {
295
+                return 'kml';
296
+            }
297
+            if (strpos($string, '<coordinate') !== false) {
298
+                return 'kml';
299
+            }
300
+            if (strpos($string, '<gpx') !== false) {
301
+                return 'gpx';
302
+            }
303
+            if (strpos($string, '<georss') !== false) {
304
+                return 'georss';
305
+            }
306
+            if (strpos($string, '<rss') !== false) {
307
+                return 'georss';
308
+            }
309
+            if (strpos($string, '<feed') !== false) {
310
+                return 'georss';
311
+            }
287 312
         }
288 313
 
289 314
         // We need an 8 byte string for geohash and unpacked WKB / WKT
Please login to merge, or discard this patch.
public/htdocs/includes/php-iban/php-iban.php 1 patch
Braces   +50 added lines, -66 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
         if(!iban_verify_checksum($iban)) { 
36 36
          return false;
37 37
               }
38
- }
39
- else {
38
+ } else {
40 39
         return false;
41 40
  }
42 41
 
@@ -547,8 +546,7 @@  discard block
 block discarded – undo
547 546
  for($i = 0;$i < strlen($incorrect_iban);$i++) {
548 547
         if(!isset($char_freqs[substr($incorrect_iban, $i, 1)])) {
549 548
          $char_freqs[substr($incorrect_iban, $i, 1)] = 1;
550
-              }
551
-        else {
549
+              } else {
552 550
          $char_freqs[substr($incorrect_iban, $i, 1)]++;
553 551
               }
554 552
  }
@@ -766,9 +764,12 @@  discard block
 block discarded – undo
766 764
         $w1 = $wi[($i_size1 - $i) % 10];
767 765
         $sigma += ($i1 * $w1) % 11; 
768 766
  }
769
- if($bModify) return str_replace('?', $hash_map[($sigma % 11)], $vString);
770
- else return $hash_map[($sigma % 11)];
771
-}
767
+ if($bModify) {
768
+     return str_replace('?', $hash_map[($sigma % 11)], $vString);
769
+ } else {
770
+     return $hash_map[($sigma % 11)];
771
+ }
772
+ }
772 773
 
773 774
 // ISO7064 MOD97-10 (Bosnia, etc.)
774 775
 // (Credit: Adapted from https://github.com/stvkoch/ISO7064-Mod-97-10/blob/master/ISO7064Mod97_10.php)
@@ -776,11 +777,15 @@  discard block
 block discarded – undo
776 777
 {
777 778
  $ai = 1;
778 779
  $ch = ord($str[strlen($str) - 1]) - 48;
779
- if($ch < 0 || $ch > 9) return false;
780
+ if($ch < 0 || $ch > 9) {
781
+     return false;
782
+ }
780 783
  $check = $ch;
781 784
  for($i = strlen($str) - 2;$i >= 0;$i--) {
782 785
         $ch = ord($str[$i]) - 48;
783
-        if ($ch < 0 || $ch > 9) return false;
786
+        if ($ch < 0 || $ch > 9) {
787
+            return false;
788
+        }
784 789
         $ai = ($ai * 10) % 97;
785 790
         $check += ($ai * ((int)$ch));
786 791
  }
@@ -799,11 +804,9 @@  discard block
 block discarded – undo
799 804
  $expected_nationalchecksum = $bban_less_checksum % 97;
800 805
  if($mode == 'find') {
801 806
         return $expected_nationalchecksum;
802
- }
803
- elseif($mode == 'set') {
807
+ } elseif($mode == 'set') {
804 808
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
805
- }
806
- elseif($mode == 'verify') {
809
+ } elseif($mode == 'verify') {
807 810
         return ($nationalchecksum == $expected_nationalchecksum);
808 811
  }
809 812
 }
@@ -812,15 +815,21 @@  discard block
 block discarded – undo
812 815
 // (Credit: @dem3trio, code lifted from Spanish Wikipedia at https://es.wikipedia.org/wiki/C%C3%B3digo_cuenta_cliente)
813 816
 function _iban_nationalchecksum_implementation_es_mod11_helper($numero)
814 817
 {
815
- if(strlen($numero) != 10) return "?";
818
+ if(strlen($numero) != 10) {
819
+     return "?";
820
+ }
816 821
  $cifras = array(1,2,4,8,5,10,9,7,3,6);
817 822
  $chequeo = 0;
818 823
  for($i = 0; $i < 10; $i++) {
819 824
         $chequeo += substr($numero, $i, 1) * $cifras[$i];
820 825
  }
821 826
  $chequeo = 11 - ($chequeo % 11);
822
- if ($chequeo == 11) $chequeo = 0;
823
- if ($chequeo == 10) $chequeo = 1;
827
+ if ($chequeo == 11) {
828
+     $chequeo = 0;
829
+ }
830
+ if ($chequeo == 10) {
831
+     $chequeo = 1;
832
+ }
824 833
  return $chequeo;
825 834
 }
826 835
 
@@ -841,11 +850,9 @@  discard block
 block discarded – undo
841 850
  $expected_nationalchecksum .= _iban_nationalchecksum_implementation_es_mod11_helper($account_less_checksum);
842 851
  if($mode == 'find') {
843 852
         return $expected_nationalchecksum;
844
- }
845
- elseif($mode == 'set') {
853
+ } elseif($mode == 'set') {
846 854
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
847
- }
848
- elseif($mode == 'verify') {
855
+ } elseif($mode == 'verify') {
849 856
         return ($nationalchecksum == $expected_nationalchecksum);
850 857
  }
851 858
 }
@@ -863,13 +870,11 @@  discard block
 block discarded – undo
863 870
  for ($i = 0; $i < strlen($bban); $i++) {
864 871
         if(is_numeric($bban[$i])) {
865 872
          $allNumbers .= $bban[$i];
866
-              }
867
-        else {
873
+              } else {
868 874
          $letter = strtoupper($bban[$i]);
869 875
          if(array_key_exists($letter, $conversion)) {
870 876
                 $allNumbers .= $conversion[$letter];
871
-         }
872
-         else {
877
+         } else {
873 878
                 return null;
874 879
          }
875 880
               }
@@ -966,11 +971,9 @@  discard block
 block discarded – undo
966 971
  // return
967 972
  if($mode == 'find') {
968 973
         return $expected_nationalchecksum;
969
- }
970
- elseif($mode == 'set') {
974
+ } elseif($mode == 'set') {
971 975
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
972
- }
973
- elseif($mode == 'verify') {
976
+ } elseif($mode == 'verify') {
974 977
         return (iban_get_nationalchecksum_part($iban) == $expected_nationalchecksum);
975 978
  }
976 979
 }
@@ -1004,15 +1007,12 @@  discard block
 block discarded – undo
1004 1007
  $calculated_checksum = ($nationalchecksum + $remainder) % 10;
1005 1008
  if($mode == 'find') {
1006 1009
         if($remainder == 0) { return $nationalchecksum; 
1007
-            }
1008
-        else {
1010
+            } else {
1009 1011
          return $calculated_checksum;
1010 1012
               }
1011
- }
1012
- elseif($mode == 'set') {
1013
+ } elseif($mode == 'set') {
1013 1014
         return _iban_nationalchecksum_set($iban, $calculated_checksum);
1014
- }
1015
- elseif($mode == 'verify') {
1015
+ } elseif($mode == 'verify') {
1016 1016
         if($remainder == 0) { return true; 
1017 1017
             }
1018 1018
         return false;
@@ -1059,11 +1059,9 @@  discard block
 block discarded – undo
1059 1059
  // return
1060 1060
  if($mode == 'find') {
1061 1061
         return $expected_nationalchecksum;
1062
- }
1063
- elseif($mode == 'set') {
1062
+ } elseif($mode == 'set') {
1064 1063
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1065
- }
1066
- elseif($mode == 'verify') {
1064
+ } elseif($mode == 'verify') {
1067 1065
         return (iban_get_nationalchecksum_part($iban) == $expected_nationalchecksum);
1068 1066
  }
1069 1067
 }
@@ -1084,11 +1082,9 @@  discard block
 block discarded – undo
1084 1082
  // return
1085 1083
  if($mode == 'find') {
1086 1084
         return $expected_nationalchecksum;
1087
- }
1088
- elseif($mode == 'set') {
1085
+ } elseif($mode == 'set') {
1089 1086
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1090
- }
1091
- elseif($mode == 'verify') {
1087
+ } elseif($mode == 'verify') {
1092 1088
         return (iban_get_nationalchecksum_part($iban) == $expected_nationalchecksum);
1093 1089
  }
1094 1090
 }
@@ -1110,11 +1106,9 @@  discard block
 block discarded – undo
1110 1106
  // return
1111 1107
  if($mode == 'find') {
1112 1108
         return $expected_nationalchecksum;
1113
- }
1114
- elseif($mode == 'set') {
1109
+ } elseif($mode == 'set') {
1115 1110
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1116
- }
1117
- elseif($mode == 'verify') {
1111
+ } elseif($mode == 'verify') {
1118 1112
         return (iban_get_nationalchecksum_part($iban) == $expected_nationalchecksum);
1119 1113
  }
1120 1114
 }
@@ -1180,14 +1174,12 @@  discard block
 block discarded – undo
1180 1174
  $remainder = $checksum % 11;
1181 1175
  if($mode == 'verify') {
1182 1176
         return ($remainder == 0); // we return the result of mod11, if 0 it's good
1183
- }
1184
- elseif($mode == 'set') {
1177
+ } elseif($mode == 'set') {
1185 1178
         if($remainder == 0) {
1186 1179
          return $iban; // we return as expected if the checksum is ok
1187 1180
               }
1188 1181
         return ''; // we return unimplemented if the checksum is bad
1189
- }
1190
- elseif($mode == 'find') {
1182
+ } elseif($mode == 'find') {
1191 1183
         return ''; // does not make sense for this 0-digit checksum
1192 1184
  }
1193 1185
 }
@@ -1204,11 +1196,9 @@  discard block
 block discarded – undo
1204 1196
  $expected_nationalchecksum = _iso7064_mod97_10_generated($bban_less_checksum);
1205 1197
  if($mode == 'find') {
1206 1198
         return $expected_nationalchecksum;
1207
- }
1208
- elseif($mode == 'set') {
1199
+ } elseif($mode == 'set') {
1209 1200
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1210
- }
1211
- elseif($mode == 'verify') {
1201
+ } elseif($mode == 'verify') {
1212 1202
         return ($nationalchecksum == $expected_nationalchecksum);
1213 1203
  }
1214 1204
 }
@@ -1273,11 +1263,9 @@  discard block
 block discarded – undo
1273 1263
  $expected_nationalchecksum = _iso7064_mod97_10_generated($bban_less_checksum);
1274 1264
  if($mode == 'find') {
1275 1265
         return $expected_nationalchecksum;
1276
- }
1277
- elseif($mode == 'set') {
1266
+ } elseif($mode == 'set') {
1278 1267
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1279
- }
1280
- elseif($mode == 'verify') {
1268
+ } elseif($mode == 'verify') {
1281 1269
         return ($nationalchecksum == $expected_nationalchecksum);
1282 1270
  }
1283 1271
 }
@@ -1294,11 +1282,9 @@  discard block
 block discarded – undo
1294 1282
  $expected_nationalchecksum = _iso7064_mod97_10_generated($bban_less_checksum);
1295 1283
  if($mode == 'find') {
1296 1284
         return $expected_nationalchecksum;
1297
- }
1298
- elseif($mode == 'set') {
1285
+ } elseif($mode == 'set') {
1299 1286
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1300
- }
1301
- elseif($mode == 'verify') {
1287
+ } elseif($mode == 'verify') {
1302 1288
         return ($nationalchecksum == $expected_nationalchecksum);
1303 1289
  }
1304 1290
 }
@@ -1388,11 +1374,9 @@  discard block
 block discarded – undo
1388 1374
  $expected_nationalchecksum = _italian($bban_less_checksum);
1389 1375
  if($mode == 'find') {
1390 1376
         return $expected_nationalchecksum;
1391
- }
1392
- elseif($mode == 'set') {
1377
+ } elseif($mode == 'set') {
1393 1378
         return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
1394
- }
1395
- elseif($mode == 'verify') {
1379
+ } elseif($mode == 'verify') {
1396 1380
         return (iban_get_nationalchecksum_part($iban) == $expected_nationalchecksum);
1397 1381
  }
1398 1382
 }
Please login to merge, or discard this patch.
public/htdocs/includes/printipp/BasicIPP.php 1 patch
Braces   +44 added lines, -63 removed lines patch added patch discarded remove patch
@@ -184,7 +184,9 @@  discard block
 block discarded – undo
184 184
     {
185 185
         $length = strlen($uri);
186 186
         $length = chr($length);
187
-        while (strlen($length) < 2) $length = chr(0x00) . $length;
187
+        while (strlen($length) < 2) {
188
+            $length = chr(0x00) . $length;
189
+        }
188 190
         $this->meta->printer_uri = chr(0x45) // uri type | value-tag
189 191
             . chr(0x00) . chr(0x0B) // name-length
190 192
             . "printer-uri" // printer-uri | name
@@ -210,9 +212,10 @@  discard block
 block discarded – undo
210 212
         {
211 213
             //It's a filename.  Open and stream.
212 214
             $data = fopen($this->data, "rb");
213
-            while (!feof($data)) $output = fread($data, 8192);
214
-        }
215
-        else
215
+            while (!feof($data)) {
216
+                $output = fread($data, 8192);
217
+            }
218
+        } else
216 219
         {
217 220
             $output = $this->data;
218 221
         }
@@ -279,7 +282,9 @@  discard block
 block discarded – undo
279 282
     {
280 283
         self::setBinary();
281 284
         $length = chr(strlen($mime_media_type));
282
-        while (strlen($length) < 2) $length = chr(0x00) . $length;
285
+        while (strlen($length) < 2) {
286
+            $length = chr(0x00) . $length;
287
+        }
283 288
         self::_putDebug(sprintf(_("mime type: %s"), $mime_media_type), 2);
284 289
         $this->meta->mime_media_type = chr(0x49) // document-format tag
285 290
             . self::_giveMeStringLength('document-format') . 'document-format' //
@@ -321,7 +326,9 @@  discard block
 block discarded – undo
321 326
         $document_name = substr($document_name, 0, 1023);
322 327
         $length = strlen($document_name);
323 328
         $length = chr($length);
324
-        while (strlen($length) < 2) $length = chr(0x00) . $length;
329
+        while (strlen($length) < 2) {
330
+            $length = chr(0x00) . $length;
331
+        }
325 332
         self::_putDebug(sprintf(_("document name: %s"), $document_name), 2);
326 333
         $this->meta->document_name = chr(0x41) // textWithoutLanguage tag
327 334
             . chr(0x00) . chr(0x0d) // name-length
@@ -493,8 +500,7 @@  discard block
 block discarded – undo
493 500
                     . 'page-ranges'
494 501
                     . self::_giveMeStringLength($value)
495 502
                     . $value;
496
-            }
497
-            else
503
+            } else
498 504
             {
499 505
                 $this->meta->page_ranges .=
500 506
                 $this->tags_types['rangeOfInteger']['tag']
@@ -517,44 +523,38 @@  discard block
 block discarded – undo
517 523
             if (!is_array($values))
518 524
             {
519 525
                 self::_setOperationAttribute($attribute, $values);
520
-            }
521
-            else
526
+            } else
522 527
             {
523 528
                 foreach($values as $value)
524 529
                 {
525 530
                     self::_setOperationAttribute($attribute, $value);
526 531
                 }
527 532
             }
528
-        }
529
-        elseif (in_array($attribute, $job_attributes_tags))
533
+        } elseif (in_array($attribute, $job_attributes_tags))
530 534
         {
531 535
             if (!is_array($values))
532 536
             {
533 537
                 self::_setJobAttribute($attribute, $values);
534
-            }
535
-            else
538
+            } else
536 539
             {
537 540
                 foreach($values as $value)
538 541
                 {
539 542
                     self::_setJobAttribute($attribute, $value);
540 543
                 }
541 544
             }
542
-        }
543
-        elseif (in_array($attribute, $printer_attributes_tags))
545
+        } elseif (in_array($attribute, $printer_attributes_tags))
544 546
         {
545 547
             if (!is_array($values))
546 548
             {
547 549
                 self::_setPrinterAttribute($attribute, $values);
548
-            }
549
-            else
550
+            } else
550 551
             {
551 552
                 foreach($values as $value)
552 553
                 {
553 554
                     self::_setPrinterAttribute($attribute, $value);
554 555
                 }
555 556
             }
556
-        }
557
-        else
557
+        } else
558 558
         {
559 559
             trigger_error(
560 560
                 sprintf(
@@ -583,22 +583,19 @@  discard block
 block discarded – undo
583 583
                 $this->operation_tags[$attribute]['value'],
584 584
                 $this->operation_tags[$attribute]['systag']
585 585
             );
586
-        }
587
-        elseif (in_array($attribute, $job_attributes_tags))
586
+        } elseif (in_array($attribute, $job_attributes_tags))
588 587
         {
589 588
             unset(
590 589
                 $this->job_tags[$attribute]['value'],
591 590
                 $this->job_tags[$attribute]['systag']
592 591
             );
593
-        }
594
-        elseif (in_array($attribute, $printer_attributes_tags))
592
+        } elseif (in_array($attribute, $printer_attributes_tags))
595 593
         {
596 594
             unset(
597 595
                 $this->printer_tags[$attribute]['value'],
598 596
                 $this->printer_tags[$attribute]['systag']
599 597
             );
600
-        }
601
-        else
598
+        } else
602 599
         {
603 600
             trigger_error(
604 601
                 sprintf(
@@ -720,8 +717,7 @@  discard block
 block discarded – undo
720 717
                     )
721 718
                 );
722 719
             }
723
-        }
724
-        else
720
+        } else
725 721
         {
726 722
             self::_putDebug(_("Printing DATA"));
727 723
             $this->output =
@@ -749,8 +745,7 @@  discard block
 block discarded – undo
749 745
                     sprintf("printing job %s: ", $this->last_job)
750 746
                         . $this->serveroutput->status,
751 747
                     3);
752
-            }
753
-            else
748
+            } else
754 749
             {
755 750
                 self::_errorLog(
756 751
                     sprintf("printing job: ", $this->last_job)
@@ -787,10 +782,11 @@  discard block
 block discarded – undo
787 782
         $http = new http_class();
788 783
         if (!$this->unix) {
789 784
             // DOL_LDR_CHANGE
790
-            if (empty($this->host)) $this->host = '127.0.0.1';
785
+            if (empty($this->host)) {
786
+                $this->host = '127.0.0.1';
787
+            }
791 788
             $http->host = $this->host;
792
-        }
793
-        else {
789
+        } else {
794 790
             $http->host = "localhost";
795 791
         }
796 792
         $http->with_exceptions = $this->with_exceptions;
@@ -798,8 +794,7 @@  discard block
 block discarded – undo
798 794
         {
799 795
             $http->debug = 1;
800 796
             $http->html_debug = 0;
801
-        }
802
-        else
797
+        } else
803 798
         {
804 799
             $http->debug = 0;
805 800
             $http->html_debug = 0;
@@ -845,15 +840,13 @@  discard block
 block discarded – undo
845 840
             try
846 841
             {
847 842
                 $success = $http->Open($arguments);
848
-            }
849
-            catch(httpException $e)
843
+            } catch(httpException $e)
850 844
             {
851 845
                 throw new ippException(
852 846
                     sprintf("http error: %s", $e->getMessage()),
853 847
                         $e->getErrno());
854 848
             }
855
-        }
856
-        else
849
+        } else
857 850
         {
858 851
             $success = $http->Open($arguments);
859 852
         }
@@ -873,8 +866,7 @@  discard block
 block discarded – undo
873 866
                         {
874 867
                             self::_putDebug($header_name . ": " . $http->request_headers[$header_name][$header_value]);
875 868
                         }
876
-                    }
877
-                    else
869
+                    } else
878 870
                     {
879 871
                         self::_putDebug($header_name . ": " . $http->request_headers[$header_name]);
880 872
                     }
@@ -903,8 +895,7 @@  discard block
 block discarded – undo
903 895
                                     . $headers[$header_name][$header_value];
904 896
                             $i++;
905 897
                         }
906
-                    }
907
-                    else
898
+                    } else
908 899
                     {
909 900
                         self::_putDebug($header_name . ": " . $headers[$header_name]);
910 901
                         $this->serveroutput->headers[$i] =
@@ -1254,20 +1245,16 @@  discard block
 block discarded – undo
1254 1245
         if ($status_code < 0x00FF)
1255 1246
         {
1256 1247
             $this->serveroutput->status = "successfull";
1257
-        }
1258
-        elseif ($status_code < 0x01FF)
1248
+        } elseif ($status_code < 0x01FF)
1259 1249
         {
1260 1250
             $this->serveroutput->status = "informational";
1261
-        }
1262
-        elseif ($status_code < 0x02FF)
1251
+        } elseif ($status_code < 0x02FF)
1263 1252
         {
1264 1253
             $this->serveroutput->status = "redirection";
1265
-        }
1266
-        elseif ($status_code < 0x04FF)
1254
+        } elseif ($status_code < 0x04FF)
1267 1255
         {
1268 1256
             $this->serveroutput->status = "client-error";
1269
-        }
1270
-        elseif ($status_code < 0x05FF)
1257
+        } elseif ($status_code < 0x05FF)
1271 1258
         {
1272 1259
             $this->serveroutput->status = "server-error";
1273 1260
         }
@@ -1473,8 +1460,7 @@  discard block
 block discarded – undo
1473 1460
             if (array_key_exists(0, $this->available_printers))
1474 1461
             {
1475 1462
                 self::setPrinterURI($this->available_printers[0]);
1476
-            }
1477
-            else
1463
+            } else
1478 1464
             {
1479 1465
                 trigger_error(
1480 1466
                     _("_stringJob: Printer URI is not set: die"),
@@ -1570,8 +1556,7 @@  discard block
 block discarded – undo
1570 1556
                                 . $key
1571 1557
                                 . self::_giveMeStringLength($item_value)
1572 1558
                                 . $item_value;
1573
-                    }
1574
-                    else
1559
+                    } else
1575 1560
                     {
1576 1561
                         $operationattributes .=
1577 1562
                             $values['systag']
@@ -1599,8 +1584,7 @@  discard block
 block discarded – undo
1599 1584
                                 . $key
1600 1585
                                 . self::_giveMeStringLength($item_value)
1601 1586
                                 . $item_value;
1602
-                    }
1603
-                    else
1587
+                    } else
1604 1588
                     {
1605 1589
                         $jobattributes .=
1606 1590
                             $values['systag']
@@ -1628,8 +1612,7 @@  discard block
 block discarded – undo
1628 1612
                                 . $key
1629 1613
                                 . self::_giveMeStringLength($item_value)
1630 1614
                                 . $item_value;
1631
-                    }
1632
-                    else
1615
+                    } else
1633 1616
                     {
1634 1617
                         $printerattributes .=
1635 1618
                             $values['systag']
@@ -1659,8 +1642,7 @@  discard block
 block discarded – undo
1659 1642
             if ($this->with_exceptions)
1660 1643
             {
1661 1644
                 throw new ippException($errmsg);
1662
-            }
1663
-            else
1645
+            } else
1664 1646
             {
1665 1647
                 trigger_error($errmsg, E_USER_ERROR);
1666 1648
             }
@@ -1824,8 +1806,7 @@  discard block
 block discarded – undo
1824 1806
         $int4 = $value & 0xFF; //64bits
1825 1807
         if ($initial_value < 0) {
1826 1808
             $int4 = chr($int4) | chr(0x80);
1827
-        }
1828
-        else {
1809
+        } else {
1829 1810
             $int4 = chr($int4);
1830 1811
         }
1831 1812
         $value = $int4 . chr($int3) . chr($int2) . chr($int1);
Please login to merge, or discard this patch.
public/htdocs/includes/printipp/ExtendedPrintIPP.php 1 patch
Braces   +28 added lines, -56 removed lines patch added patch discarded remove patch
@@ -93,8 +93,7 @@  discard block
 block discarded – undo
93 93
             {
94 94
                 self::_errorLog(sprintf("printing uri %s, job %s: ", $uri, $this->last_job)
95 95
                             . $this->serveroutput->status, 3);
96
-            }
97
-            else
96
+            } else
98 97
             {
99 98
                 $this->jobs = array_merge($this->jobs, array(""));
100 99
                 $this->jobs_uri = array_merge($this->jobs_uri, array(""));
@@ -130,8 +129,7 @@  discard block
 block discarded – undo
130 129
             if (array_key_exists(0, $this->available_printers))
131 130
             {
132 131
                self::setPrinterURI($this->available_printers[0]);
133
-            }
134
-            else
132
+            } else
135 133
             {
136 134
                 trigger_error(_("purgeJobs: Printer URI is not set: die"), E_USER_WARNING);
137 135
                 self::_putDebug(_("purgeJobs: Printer URI is not set: die\n"));
@@ -193,8 +191,7 @@  discard block
 block discarded – undo
193 191
             {
194 192
                 self::_errorLog(sprintf(_("purging jobs of %s: "), $this->printer_uri)
195 193
                             . $this->serveroutput->status, 3);
196
-            }
197
-            else
194
+            } else
198 195
             {
199 196
                  self::_errorLog(sprintf(_("purging jobs of %s: "), $this->printer_uri)
200 197
                                              . $this->serveroutput->status, 1);
@@ -229,8 +226,7 @@  discard block
 block discarded – undo
229 226
             if (array_key_exists(0, $this->available_printers))
230 227
             {
231 228
                self::setPrinterURI($this->available_printers[0]);
232
-            }
233
-            else
229
+            } else
234 230
             {
235 231
                 trigger_error(_("createJob: Printer URI is not set: die"), E_USER_WARNING);
236 232
                 self::_putDebug(_("createJob: Printer URI is not set: die\n"));
@@ -279,8 +275,7 @@  discard block
 block discarded – undo
279 275
             if (is_readable($this->data))
280 276
             {
281 277
                 self::setJobName(basename($this->data), true);
282
-            }
283
-            else
278
+            } else
284 279
             {
285 280
                 self::setJobName();
286 281
             }
@@ -342,8 +337,7 @@  discard block
 block discarded – undo
342 337
                 $this->_getJobId();
343 338
                 $this->_getJobUri();
344 339
                 $this->_parseJobAttributes();
345
-            }
346
-            else
340
+            } else
347 341
             {
348 342
                 $this->jobs = array_merge($this->jobs, array(''));
349 343
                 $this->jobs_uri = array_merge($this->jobs_uri, array(''));
@@ -358,8 +352,7 @@  discard block
 block discarded – undo
358 352
             {
359 353
                 self::_errorLog(sprintf(_("Create job: job %s"), $this->last_job)
360 354
                             . $this->serveroutput->status, 3);
361
-            }
362
-            else
355
+            } else
363 356
             {
364 357
                 $this->jobs = array_merge($this->jobs, array(""));
365 358
                 $this->jobs_uri = array_merge($this->jobs_uri, array(""));
@@ -408,8 +401,7 @@  discard block
 block discarded – undo
408 401
             {
409 402
                 $post_values = array_merge($post_values, array("Filetype" => "TEXT"));
410 403
             }
411
-        }
412
-        else
404
+        } else
413 405
         {
414 406
             self::_putDebug(_("sending DATA as document\n")); 
415 407
 
@@ -430,8 +422,7 @@  discard block
 block discarded – undo
430 422
                 //$this->_getPrinterUri();
431 423
                 $this->_getJobUri();
432 424
                 $this->_parseJobAttributes();
433
-            }
434
-            else
425
+            } else
435 426
             {
436 427
                 $this->jobs = array_merge($this->jobs, array($job));
437 428
                 $this->jobs_uri = array_merge($this->jobs_uri, array($job));
@@ -445,8 +436,7 @@  discard block
 block discarded – undo
445 436
             if ($this->serveroutput->status == "successfull-ok")
446 437
             {
447 438
                 self::_errorLog(sprintf("sending document, job %s: %s", $job, $this->serveroutput->status), 3);
448
-            }
449
-            else
439
+            } else
450 440
             {
451 441
                 $this->jobs = array_merge($this->jobs, array(""));
452 442
                 $this->jobs_uri = array_merge($this->jobs_uri, array(""));
@@ -488,8 +478,7 @@  discard block
 block discarded – undo
488 478
                     //$this->_getPrinterUri();
489 479
                     $this->_getJobUri();
490 480
                     $this->_parseJobAttributes();
491
-                    }
492
-                else
481
+                    } else
493 482
                 {
494 483
                     $this->jobs = array_merge($this->jobs, array($job));
495 484
                     $this->jobs_uri = array_merge($this->jobs_uri, array($job));
@@ -505,8 +494,7 @@  discard block
 block discarded – undo
505 494
                 if ($this->serveroutput->status == "successfull-ok")
506 495
                 {
507 496
                     self::_errorLog(sprintf("sending uri %s, job %s: %s", $uri, $job, $this->serveroutput->status), 3);
508
-                    }
509
-                else
497
+                    } else
510 498
                 {
511 499
                     $this->jobs = array_merge($this->jobs, array(""));
512 500
                     $this->jobs_uri = array_merge($this->jobs_uri, array(""));
@@ -543,8 +531,7 @@  discard block
 block discarded – undo
543 531
             if (array_key_exists(0, $this->available_printers))
544 532
             {
545 533
                self::setPrinterURI($this->available_printers[0]);
546
-            }
547
-            else
534
+            } else
548 535
             {
549 536
                 trigger_error(_("pausePrinter: Printer URI is not set: die"), E_USER_WARNING);
550 537
                 self::_putDebug(_("pausePrinter: Printer URI is not set: die\n"));
@@ -606,8 +593,7 @@  discard block
 block discarded – undo
606 593
             {
607 594
                 self::_errorLog(sprintf(_("Pause printer %s: "), $this->printer_uri)
608 595
                             . $this->serveroutput->status, 3);
609
-            }
610
-            else
596
+            } else
611 597
             {
612 598
                  self::_errorLog(sprintf(_("pause printer %s: "), $this->printer_uri)
613 599
                                              . $this->serveroutput->status, 1);
@@ -646,8 +632,7 @@  discard block
 block discarded – undo
646 632
             if (array_key_exists(0, $this->available_printers))
647 633
             {
648 634
                self::setPrinterURI($this->available_printers[0]);
649
-            }
650
-            else
635
+            } else
651 636
             {
652 637
                 trigger_error(_("resumePrinter: Printer URI is not set: die"), E_USER_WARNING);
653 638
                 self::_putDebug(_("resumePrinter: Printer URI is not set: die\n"));
@@ -704,8 +689,7 @@  discard block
 block discarded – undo
704 689
             {
705 690
                 self::_errorLog(sprintf(_("resume printer %s: "), $this->printer_uri)
706 691
                             . $this->serveroutput->status, 3);
707
-            }
708
-            else
692
+            } else
709 693
             {
710 694
                  self::_errorLog(sprintf(_("resume printer %s: "), $this->printer_uri)
711 695
                                              . $this->serveroutput->status, 1);
@@ -760,8 +744,7 @@  discard block
 block discarded – undo
760 744
         if (in_array($until, $until_strings))
761 745
         {
762 746
             true;
763
-        }
764
-        else 
747
+        } else 
765 748
         {
766 749
             $until = 'indefinite';
767 750
         }
@@ -806,8 +789,7 @@  discard block
 block discarded – undo
806 789
             {
807 790
                 self::_errorLog(sprintf(_("hold job %s until %s: "), $job_uri, $until)
808 791
                             . $this->serveroutput->status, 3);
809
-            }
810
-            else
792
+            } else
811 793
             {
812 794
                  self::_errorLog(sprintf(_("hold job %s until %s: "), $job_uri, $until)
813 795
                                              . $this->serveroutput->status, 1);
@@ -891,8 +873,7 @@  discard block
 block discarded – undo
891 873
             {
892 874
                 self::_errorLog(sprintf(_("release job %s: "), $job_uri)
893 875
                             . $this->serveroutput->status, 3);
894
-            }
895
-            else
876
+            } else
896 877
             {
897 878
                  self::_errorLog(sprintf(_("release job %s: "), $job_uri)
898 879
                                              . $this->serveroutput->status, 1);
@@ -983,8 +964,7 @@  discard block
 block discarded – undo
983 964
             {
984 965
                 self::_errorLog(sprintf(_("release job %s: "), $job_uri)
985 966
                             . $this->serveroutput->status, 3);
986
-            }
987
-            else
967
+            } else
988 968
             {
989 969
                  self::_errorLog(sprintf(_("release job %s: "), $job_uri)
990 970
                                              . $this->serveroutput->status, 1);
@@ -1103,8 +1083,7 @@  discard block
 block discarded – undo
1103 1083
             {
1104 1084
                 self::_errorLog(sprintf(_("set job attributes for job %s: "), $job_uri)
1105 1085
                             . $this->serveroutput->status, 3);
1106
-            }
1107
-            else
1086
+            } else
1108 1087
             {
1109 1088
                  self::_errorLog(sprintf(_("set job attributes for job %s: "), $job_uri)
1110 1089
                                              . $this->serveroutput->status, 1);
@@ -1250,8 +1229,7 @@  discard block
 block discarded – undo
1250 1229
             {
1251 1230
                 self::_errorLog(sprintf(_("set printer attributes for printer %s: "), $this->printer_uri)
1252 1231
                             . $this->serveroutput->status, 3);
1253
-            }
1254
-            else
1232
+            } else
1255 1233
             {
1256 1234
                  self::_errorLog(sprintf(_("set printer attributes for printer %s: "), $this->printer_uri)
1257 1235
                                              . $this->serveroutput->status, 1);
@@ -1307,8 +1285,7 @@  discard block
 block discarded – undo
1307 1285
             if (array_key_exists(0, $this->available_printers))
1308 1286
             {
1309 1287
                self::setPrinterURI($this->available_printers[0]);
1310
-            }
1311
-            else
1288
+            } else
1312 1289
             {
1313 1290
                 trigger_error(_("_stringUri: Printer URI is not set: die"), E_USER_WARNING);
1314 1291
                 self::_putDebug(_("_stringUri: Printer URI is not set: die\n"));
@@ -1353,8 +1330,7 @@  discard block
 block discarded – undo
1353 1330
             if (is_readable($this->data))
1354 1331
             {
1355 1332
                 self::setJobName(basename($this->data), true);
1356
-            }
1357
-            else
1333
+            } else
1358 1334
             {
1359 1335
                 self::setJobName();
1360 1336
             }
@@ -1429,8 +1405,7 @@  discard block
 block discarded – undo
1429 1405
         if ($is_last == false)
1430 1406
         {
1431 1407
             $is_last = chr(0x00);
1432
-        }
1433
-        else
1408
+        } else
1434 1409
         {
1435 1410
             $is_last = chr(0x01);
1436 1411
         }
@@ -1454,8 +1429,7 @@  discard block
 block discarded – undo
1454 1429
             if (array_key_exists(0, $this->available_printers))
1455 1430
             {
1456 1431
                self::setPrinterURI($this->available_printers[0]);
1457
-            }
1458
-            else
1432
+            } else
1459 1433
             {
1460 1434
                 trigger_error(_("_stringJob: Printer URI is not set: die"), E_USER_WARNING);
1461 1435
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"));
@@ -1555,8 +1529,7 @@  discard block
 block discarded – undo
1555 1529
         if ($is_last == false)
1556 1530
         {
1557 1531
             $is_last = chr(0x00);
1558
-        }
1559
-        else
1532
+        } else
1560 1533
         {
1561 1534
             $is_last = chr(0x01);
1562 1535
         }
@@ -1580,8 +1553,7 @@  discard block
 block discarded – undo
1580 1553
             if (array_key_exists(0, $this->available_printers))
1581 1554
             {
1582 1555
                self::setPrinterURI($this->available_printers[0]);
1583
-            } 
1584
-            else
1556
+            } else
1585 1557
             {
1586 1558
                 trigger_error(_("_stringJob: Printer URI is not set: die"), E_USER_WARNING);
1587 1559
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"));
Please login to merge, or discard this patch.
public/htdocs/includes/printipp/http_class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -483,8 +483,9 @@
 block discarded – undo
483 483
         }
484 484
         $nc = sprintf('%x', $this->nc);
485 485
         $prepend = "";
486
-        while ((strlen($nc) + strlen($prepend)) < 8)
487
-            $prependi .= "0";
486
+        while ((strlen($nc) + strlen($prepend)) < 8) {
487
+                    $prependi .= "0";
488
+        }
488 489
         $nc = $prepend . $nc;
489 490
         $cnonce = "printipp";
490 491
         $username = $this->user;
Please login to merge, or discard this patch.
public/htdocs/includes/printipp/CupsPrintIPP.php 1 patch
Braces   +13 added lines, -22 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
                                         . 'requested-attributes'
86 86
                                         . self::_giveMeStringLength($attributes[0])
87 87
                                         . $attributes[0];
88
-            }
89
-            else
88
+            } else
90 89
             {
91 90
                 $this->meta->attributes .= chr(0x44) // Keyword
92 91
                                         . chr(0x0) . chr(0x0) // zero-length name
@@ -139,15 +138,13 @@  discard block
 block discarded – undo
139 138
             if ($this->serveroutput->status == "successfull-ok")
140 139
             {
141 140
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 3);
142
-            }
143
-            else
141
+            } else
144 142
             {
145 143
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 1);
146 144
             }
147 145
 
148 146
             return $this->serveroutput->status;
149
-        }
150
-        else
147
+        } else
151 148
         {
152 149
             $this->status = array_merge($this->status, array("OPERATION FAILED"));
153 150
             self::_errorLog("getting defaults : OPERATION FAILED", 1);
@@ -211,15 +208,13 @@  discard block
 block discarded – undo
211 208
             if ($this->serveroutput->status == "successfull-ok")
212 209
             {
213 210
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 3);
214
-            }
215
-            else
211
+            } else
216 212
             {
217 213
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 1);
218 214
             }
219 215
 
220 216
             return $this->serveroutput->status;
221
-        }
222
-        else
217
+        } else
223 218
         {
224 219
             $this->status = array_merge($this->status, array("OPERATION FAILED"));
225 220
             self::_errorLog("getting defaults : OPERATION FAILED", 1);
@@ -295,15 +290,13 @@  discard block
 block discarded – undo
295 290
             if ($this->serveroutput->status == "successfull-ok")
296 291
             {
297 292
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 3);
298
-            }
299
-            else
293
+            } else
300 294
             {
301 295
                 self::_errorLog("getting defaults: " . $this->serveroutput->status, 1);
302 296
             }
303 297
 
304 298
             return $this->serveroutput->status;
305
-        }
306
-        else
299
+        } else
307 300
         {
308 301
             $this->status = array_merge($this->status, array("OPERATION FAILED"));
309 302
             self::_errorLog("getting defaults : OPERATION FAILED", 1);
@@ -365,8 +358,7 @@  discard block
 block discarded – undo
365 358
                                         . 'requested-attributes'
366 359
                                         . self::_giveMeStringLength($attributes[0])
367 360
                                         . $attributes[0];
368
-            }
369
-            else
361
+            } else
370 362
             {
371 363
                 $this->meta->attributes .= chr(0x44) // Keyword
372 364
                                         . chr(0x0) . chr(0x0) // zero-length name
@@ -403,14 +395,12 @@  discard block
 block discarded – undo
403 395
             if ($this->serveroutput->status == "successfull-ok")
404 396
             {
405 397
                 self::_errorLog("getting printers: " . $this->serveroutput->status, 3);
406
-            }
407
-            else
398
+            } else
408 399
             {
409 400
                 self::_errorLog("getting printers: " . $this->serveroutput->status, 1);
410 401
             }
411 402
             return $this->serveroutput->status;
412
-        }
413
-        else
403
+        } else
414 404
         {
415 405
             $this->status = array_merge($this->status, array("OPERATION FAILED"));
416 406
             self::_errorLog("getting printers : OPERATION FAILED", 1);
@@ -536,8 +526,9 @@  discard block
 block discarded – undo
536 526
             }
537 527
 
538 528
         $prepend = '';
539
-        while ((strlen($value_built) + strlen($prepend)) < 4)
540
-            $prepend .= chr(0);
529
+        while ((strlen($value_built) + strlen($prepend)) < 4) {
530
+                    $prepend .= chr(0);
531
+        }
541 532
         return $prepend . $value_built;
542 533
     }
543 534
 
Please login to merge, or discard this patch.
public/htdocs/includes/printipp/PrintIPP.php 1 patch
Braces   +35 added lines, -70 removed lines patch added patch discarded remove patch
@@ -78,8 +78,7 @@  discard block
 block discarded – undo
78 78
             {
79 79
                 $post_values = array_merge($post_values, array("Filetype" => "TEXT"));
80 80
             }
81
-        }
82
-        else
81
+        } else
83 82
         {
84 83
             self::_putDebug(_("Printing DATA\n"), 3); 
85 84
 
@@ -99,8 +98,7 @@  discard block
 block discarded – undo
99 98
                 $this->_getJobId();
100 99
                 $this->_getJobUri();
101 100
                 $this->_parseJobAttributes();
102
-            }
103
-            else
101
+            } else
104 102
             {
105 103
                 $this->jobs = array_merge($this->jobs, array(''));
106 104
                 $this->jobs_uri = array_merge($this->jobs_uri, array(''));
@@ -114,8 +112,7 @@  discard block
 block discarded – undo
114 112
             if ($this->serveroutput->status == "successfull-ok")
115 113
             {
116 114
               self::_errorLog(sprintf("printing job %s: ", $this->last_job) . $this->serveroutput->status, 3);
117
-            }
118
-            else
115
+            } else
119 116
             {
120 117
                 $this->jobs = array_merge($this->jobs, array(""));
121 118
                 $this->jobs_uri = array_merge($this->jobs_uri, array(""));
@@ -169,8 +166,7 @@  discard block
 block discarded – undo
169 166
             if ($this->serveroutput->status == "successfull-ok")
170 167
             {
171 168
                 self::_errorLog("cancelling job $job_uri: " . $this->serveroutput->status, 3);
172
-            }
173
-            else
169
+            } else
174 170
             {
175 171
                 self::_errorLog("cancelling job $job_uri: " . $this->serveroutput->status, 1);
176 172
             }
@@ -213,8 +209,7 @@  discard block
 block discarded – undo
213 209
             if (array_key_exists(0, $this->available_printers))
214 210
             {
215 211
                self::setPrinterURI($this->available_printers[0]);
216
-            }
217
-            else
212
+            } else
218 213
             {
219 214
                 trigger_error(_("_stringJob: Printer URI is not set: die"), E_USER_WARNING);
220 215
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"), 3);
@@ -253,8 +248,7 @@  discard block
 block discarded – undo
253 248
             if (is_readable($this->data))
254 249
             {
255 250
                 self::setJobName(basename($this->data), true);
256
-            }
257
-            else
251
+            } else
258 252
             {
259 253
                 self::setJobName();
260 254
             }
@@ -335,8 +329,7 @@  discard block
 block discarded – undo
335 329
             if ($this->serveroutput->status == "successfull-ok")
336 330
             {
337 331
                 self::_errorLog("validate job: " . $this->serveroutput->status, 3);
338
-            }
339
-            else
332
+            } else
340 333
             {
341 334
                 self::_errorLog("validate job: " . $this->serveroutput->status, 1);
342 335
             }
@@ -371,8 +364,7 @@  discard block
 block discarded – undo
371 364
             if (array_key_exists(0, $this->available_printers))
372 365
             {
373 366
                self::setPrinterURI($this->available_printers[0]);
374
-            }
375
-            else
367
+            } else
376 368
             {
377 369
                 trigger_error(_("_stringJob: Printer URI is not set: die"), E_USER_WARNING);
378 370
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"), 3);
@@ -435,8 +427,7 @@  discard block
 block discarded – undo
435 427
                 self::_errorLog(sprintf(
436 428
                     _("getting printer attributes of %s: %s"), $this->printer_uri,
437 429
                                                                         $this->serveroutput->status), 3);
438
-            }
439
-            else 
430
+            } else 
440 431
             {
441 432
                 self::_errorLog(sprintf(
442 433
                     _("getting printer attributes of %s: %s"), $this->printer_uri,
@@ -475,8 +466,7 @@  discard block
 block discarded – undo
475 466
             if (array_key_exists(0, $this->available_printers))
476 467
             {
477 468
                self::setPrinterURI($this->available_printers[0]);
478
-            }
479
-            else
469
+            } else
480 470
             {
481 471
                 trigger_error(_("getJobs: Printer URI is not set: die"), E_USER_WARNING);
482 472
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"), 3);
@@ -508,8 +498,7 @@  discard block
 block discarded – undo
508 498
                                . 'limit'
509 499
                                . self::_giveMeStringLength($limit)
510 500
                                . $limit;
511
-        }
512
-        else
501
+        } else
513 502
         {
514 503
             $this->meta->limit = '';
515 504
         }
@@ -521,8 +510,7 @@  discard block
 block discarded – undo
521 510
                                         . 'which-jobs'
522 511
                                         . self::_giveMeStringLength($which_jobs)
523 512
                                         . $which_jobs;
524
-        }
525
-        else
513
+        } else
526 514
         {
527 515
             $this->meta->which_jobs = "";
528 516
         }
@@ -534,8 +522,7 @@  discard block
 block discarded – undo
534 522
                                  . 'my-jobs'
535 523
                                  . self::_giveMeStringLength(chr(0x01))
536 524
                                  . chr(0x01);
537
-        }
538
-        else
525
+        } else
539 526
         {
540 527
             $this->meta->my_jobs = '';
541 528
         }
@@ -574,8 +561,7 @@  discard block
 block discarded – undo
574 561
                          . ''
575 562
                          . self::_giveMeStringLength('job-state-reason')
576 563
                          . 'job-state-reason';
577
-        }
578
-        else
564
+        } else
579 565
         { // cups 1.4.4 doesn't return much of anything without this
580 566
             $this->stringjob .=
581 567
                           chr(0x44) // keyword
@@ -613,8 +599,7 @@  discard block
 block discarded – undo
613 599
             {
614 600
                 self::_errorLog(sprintf(_("getting jobs of printer %s: "), $this->printer_uri)
615 601
                             . $this->serveroutput->status, 3);
616
-            }
617
-            else
602
+            } else
618 603
             {
619 604
                  self::_errorLog(sprintf(_("getting jobs of printer %s: "), $this->printer_uri)
620 605
                                              . $this->serveroutput->status, 1);
@@ -659,8 +644,7 @@  discard block
 block discarded – undo
659 644
             if (array_key_exists(0, $this->available_printers))
660 645
             {
661 646
                self::setPrinterURI($this->available_printers[0]);
662
-            }
663
-            else
647
+            } else
664 648
             {
665 649
                 trigger_error(_("getJobs: Printer URI is not set: die"), E_USER_WARNING);
666 650
                 self::_putDebug(_("_stringJob: Printer URI is not set: die\n"), 3);
@@ -721,8 +705,7 @@  discard block
 block discarded – undo
721 705
                          . ''
722 706
                          . self::_giveMeStringLength('job-state-reason')
723 707
                          . 'job-state-reason';
724
-        }
725
-        elseif($attributes_group)
708
+        } elseif($attributes_group)
726 709
         {
727 710
             switch($attributes_group)
728 711
             {
@@ -773,8 +756,7 @@  discard block
 block discarded – undo
773 756
             {
774 757
                 self::_errorLog(sprintf(_("getting job attributes for %s: "), $job_uri)
775 758
                             . $this->serveroutput->status, 3);
776
-            }
777
-            else
759
+            } else
778 760
             {
779 761
                  self::_errorLog(sprintf(_("getting job attributes for %s: "), $job_uri)
780 762
                                              . $this->serveroutput->status, 1);
@@ -877,8 +859,7 @@  discard block
 block discarded – undo
877 859
                     $this->parsed[$k]['name'] = $this->serveroutput->response[$i][$j]['name'];
878 860
                     $this->parsed[$k]['type'] = $this->serveroutput->response[$i][$j]['type'];
879 861
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
880
-                }
881
-                else
862
+                } else
882 863
                 {
883 864
                     $l++;
884 865
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
@@ -932,8 +913,7 @@  discard block
 block discarded – undo
932 913
                     $this->parsed[$job][$k]['name'] = $this->serveroutput->response[$i][$j]['name'];
933 914
                     $this->parsed[$job][$k]['type'] = $this->serveroutput->response[$i][$j]['type'];
934 915
                     $this->parsed[$job][$k][$l] = $this->serveroutput->response[$i][$j]['value'];
935
-                }
936
-                else
916
+                } else
937 917
                 {
938 918
                     $l++;
939 919
                     $this->parsed[$job][$k][$l] = $this->serveroutput->response[$i][$j]['value'];
@@ -997,8 +977,7 @@  discard block
 block discarded – undo
997 977
                     $this->collection_depth++;
998 978
                     $this->index--;
999 979
                     $this->collection_nbr[$this->collection_depth]++;
1000
-                }
1001
-                else
980
+                } else
1002 981
                 {
1003 982
                     $this->collection_depth++;
1004 983
                     if ($this->collection_depth == 0)
@@ -1008,8 +987,7 @@  discard block
 block discarded – undo
1008 987
                     if (array_key_exists($this->collection_depth, $this->collection_nbr))
1009 988
                     {
1010 989
                         $this->collection_nbr[$this->collection_depth]++;
1011
-                    }
1012
-                    else
990
+                    } else
1013 991
                     {
1014 992
                         $this->collection_nbr[$this->collection_depth] = 0;
1015 993
                     }
@@ -1043,8 +1021,7 @@  discard block
 block discarded – undo
1043 1021
                 if (!$attribute_name)
1044 1022
                 {
1045 1023
                     $attribute_name = $this->attribute_name;
1046
-                }
1047
-                else
1024
+                } else
1048 1025
                 {
1049 1026
                     $this->attribute_name = $attribute_name;
1050 1027
                 }
@@ -1157,24 +1134,19 @@  discard block
 block discarded – undo
1157 1134
                 if ($tag >= 0x14 && $tag < 0x15 && $tag > 0x17 && $tag <= 0x1f) 
1158 1135
                 {
1159 1136
                     $tag = "out-of-band";
1160
-                }
1161
-                elseif (0x24 <= $tag && $tag <= 0x2f) 
1137
+                } elseif (0x24 <= $tag && $tag <= 0x2f) 
1162 1138
                 {
1163 1139
                     $tag = "new integer type";
1164
-                }
1165
-                elseif (0x38 <= $tag && $tag <= 0x3F) 
1140
+                } elseif (0x38 <= $tag && $tag <= 0x3F) 
1166 1141
                 {
1167 1142
                     $tag = "new octet-stream type";
1168
-                }
1169
-                elseif (0x4B <= $tag && $tag <= 0x5F) 
1143
+                } elseif (0x4B <= $tag && $tag <= 0x5F) 
1170 1144
                 {
1171 1145
                     $tag = "new character string type";
1172
-                }
1173
-                elseif ((0x60 <= $tag && $tag < 0x7f) || $tag >= 0x80)
1146
+                } elseif ((0x60 <= $tag && $tag < 0x7f) || $tag >= 0x80)
1174 1147
                 {
1175 1148
                     $tag = "IETF reserved for future";
1176
-                }
1177
-                else
1149
+                } else
1178 1150
                 {
1179 1151
                     $tag = sprintf("UNKNOWN: 0x%x (%u)", $tag, $tag);
1180 1152
                 }
@@ -1228,8 +1200,7 @@  discard block
 block discarded – undo
1228 1200
         {
1229 1201
             $attribute_name = $this->last_attribute_name;
1230 1202
             $this->collection_key[$this->collection_depth]++;
1231
-        }
1232
-        else
1203
+        } else
1233 1204
         {
1234 1205
             $this->collection_key[$this->collection_depth] = 0;
1235 1206
         }
@@ -1388,8 +1359,7 @@  discard block
 block discarded – undo
1388 1359
                     $this->parsed[$k]['name'] = $this->serveroutput->response[$i][$j]['name'];
1389 1360
                     $this->parsed[$k]['type'] = $this->serveroutput->response[$i][$j]['type'];
1390 1361
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
1391
-                }
1392
-                else
1362
+                } else
1393 1363
                 {
1394 1364
                     $l++;
1395 1365
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
@@ -1436,8 +1406,7 @@  discard block
 block discarded – undo
1436 1406
                     $this->parsed[$k]['name'] = $this->serveroutput->response[$i][$j]['name'];
1437 1407
                     $this->parsed[$k]['type'] = $this->serveroutput->response[$i][$j]['type'];
1438 1408
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
1439
-                }
1440
-                else
1409
+                } else
1441 1410
                 {
1442 1411
                     $l++;
1443 1412
                     $this->parsed[$k][$l] = $this->serveroutput->response[$i][$j]['value'];
@@ -1483,8 +1452,7 @@  discard block
 block discarded – undo
1483 1452
                 if ($value == 0x00)
1484 1453
                 {
1485 1454
                     $value = 'false';
1486
-                }
1487
-                else
1455
+                } else
1488 1456
                 {
1489 1457
                     $value = 'true';
1490 1458
                 }
@@ -1755,19 +1723,16 @@  discard block
 block discarded – undo
1755 1723
                 if ($value_parsed > 0x002B && $value_parsed <= 0x3FFF)
1756 1724
                 {
1757 1725
                     $value = sprintf('Unknown(IETF standards track operations reserved): 0x%x', $value_parsed);
1758
-                }
1759
-                elseif ($value_parsed >= 0x4000 && $value_parsed <= 0x8FFF)
1726
+                } elseif ($value_parsed >= 0x4000 && $value_parsed <= 0x8FFF)
1760 1727
                 {
1761 1728
                     if (method_exists($this, '_getEnumVendorExtensions'))
1762 1729
                     {
1763 1730
                         $value = $this->_getEnumVendorExtensions($value_parsed);
1764
-                    }
1765
-                    else
1731
+                    } else
1766 1732
                     {
1767 1733
                         $value = sprintf('Unknown(Vendor extension for operations): 0x%x', $value_parsed);
1768 1734
                     }
1769
-                }
1770
-                elseif ($value_parsed > 0x8FFF)
1735
+                } elseif ($value_parsed > 0x8FFF)
1771 1736
                 {
1772 1737
                     $value = sprintf('Unknown operation (should not exists): 0x%x', $value_parsed);
1773 1738
                 }
Please login to merge, or discard this patch.
public/htdocs/product/class/api_products.class.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -467,13 +467,23 @@
 block discarded – undo
467 467
                 if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) {
468 468
                     $pricemodified = true;
469 469
                 } else {
470
-                    if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) $pricemodified = true;
470
+                    if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) {
471
+                        $pricemodified = true;
472
+                    }
471 473
                     if ($this->product->multiprices_base_type[$key] == 'TTC') {
472
-                        if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) $pricemodified = true;
473
-                        if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) $pricemodified = true;
474
+                        if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) {
475
+                            $pricemodified = true;
476
+                        }
477
+                        if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) {
478
+                            $pricemodified = true;
479
+                        }
474 480
                     } else {
475
-                        if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) $pricemodified = true;
476
-                        if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) $pricemodified = true;
481
+                        if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) {
482
+                            $pricemodified = true;
483
+                        }
484
+                        if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) {
485
+                            $pricemodified = true;
486
+                        }
477 487
                     }
478 488
                 }
479 489
                 if ($pricemodified && $result > 0) {
Please login to merge, or discard this patch.