Passed
Push — master ( e62a8d...f6e622 )
by Felipe
04:35 queued 02:04
created
src/Histogram/Histogram.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $this->_stats = new \HuasoFoundries\Math\Stats();
117 117
 
118 118
         $this->_statsMode = $statsMode;
119
-        $delta = ($this->_rangeHigh - $this->_rangeLow) / $this->_nbins;
119
+        $delta = ($this->_rangeHigh - $this->_rangeLow)/$this->_nbins;
120 120
         $lastpos = 0;
121 121
         $cumm = 0;
122 122
         $data = $this->_histogramData();
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         $ignoreList = array();
125 125
 
126 126
         for ($i = 0; $i < $this->_nbins; $i++) {
127
-            $loBin = $this->_rangeLow + $i * $delta;
127
+            $loBin = $this->_rangeLow + $i*$delta;
128 128
             $hiBin = $loBin + $delta;
129 129
             $this->_bins[$i]["low"] = $loBin;
130 130
             $this->_bins[$i]["high"] = $hiBin;
131
-            $this->_bins[$i]["mid"] = ($hiBin + $loBin) / 2;
131
+            $this->_bins[$i]["mid"] = ($hiBin + $loBin)/2;
132 132
             if ($this->_type == self::HISTOGRAM_CUMMULATIVE) {
133 133
                 $this->_bins[$i]["count"] = $cumm;
134 134
             } else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             $out[] = "{$bin}{$separator}{$freq}";
218 218
         }
219 219
 
220
-        return implode("\n", $out) . "\n";
220
+        return implode("\n", $out)."\n";
221 221
     }
222 222
 
223 223
     /**
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
             throw new \PEAR_Exception("histogram has not been calculated");
280 280
         }
281 281
         $out = ($this->_type == self::HISTOGRAM_CUMMULATIVE) ? "Cummulative Frequency" : "Histogram";
282
-        $out .= "\n\tNumber of bins: " . $this->_nbins . "\n";
283
-        $out .= "\tPlot range: [" . $this->_rangeLow . ", " . $this->_rangeHigh . "]\n";
282
+        $out .= "\n\tNumber of bins: ".$this->_nbins."\n";
283
+        $out .= "\tPlot range: [".$this->_rangeLow.", ".$this->_rangeHigh."]\n";
284 284
         $hdata = $this->_histogramData();
285
-        $out .= "\tData range: [" . min($hdata) . ", " . max($hdata) . "]\n";
286
-        $out .= "\tOriginal data range: [" . min($this->_data) . ", " . max($this->_data) . "]\n";
285
+        $out .= "\tData range: [".min($hdata).", ".max($hdata)."]\n";
286
+        $out .= "\tOriginal data range: [".min($this->_data).", ".max($this->_data)."]\n";
287 287
         $out .= "BIN (FREQUENCY) ASCII_BAR (%)\n";
288 288
         $fmt = "%-4.3f (%-4d) |%s\n";
289 289
         $bins = $this->_filterBins($mode);
@@ -308,14 +308,14 @@  discard block
 block discarded – undo
308 308
     public function _bar($freq, $maxfreq, $total)
309 309
     {
310 310
 
311
-        $fact = floatval(($maxfreq > 40) ? 40 / $maxfreq : 1);
312
-        $niter = round($freq * $fact);
311
+        $fact = floatval(($maxfreq > 40) ? 40/$maxfreq : 1);
312
+        $niter = round($freq*$fact);
313 313
         $out = "";
314 314
         for ($i = 0; $i < $niter; $i++) {
315 315
             $out .= "*";
316 316
         }
317 317
 
318
-        return $out . sprintf(" (%.1f%%)", $freq / $total * 100);
318
+        return $out.sprintf(" (%.1f%%)", $freq/$total*100);
319 319
 
320 320
     }
321 321
 
Please login to merge, or discard this patch.
src/Histogram/Histogram3D.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
         $this->_bins = array();
113 113
         $this->_stats = array('x' => new \HuasoFoundries\Math\Stats(), 'y' => new \HuasoFoundries\Math\Stats());
114 114
         $this->_statsMode = $statsMode;
115
-        $deltaX = ($this->_rangeHigh['x'] - $this->_rangeLow['x']) / $this->_nbins['x'];
116
-        $deltaY = ($this->_rangeHigh['y'] - $this->_rangeLow['y']) / $this->_nbins['y'];
115
+        $deltaX = ($this->_rangeHigh['x'] - $this->_rangeLow['x'])/$this->_nbins['x'];
116
+        $deltaY = ($this->_rangeHigh['y'] - $this->_rangeLow['y'])/$this->_nbins['y'];
117 117
         $data = $this->_histogramData();
118 118
         //$dataX = $this->_data['x'];
119 119
         //$dataY = $this->_data['y'];
@@ -123,15 +123,15 @@  discard block
 block discarded – undo
123 123
         $cumm = 0;
124 124
         $nData = count($dataX);
125 125
         for ($i = 0; $i < $this->_nbins['x']; $i++) {
126
-            $loXBin = $this->_rangeLow['x'] + $i * $deltaX;
126
+            $loXBin = $this->_rangeLow['x'] + $i*$deltaX;
127 127
             $hiXBin = $loXBin + $deltaX;
128 128
             $xBin = array('low' => $loXBin, 'high' => $hiXBin,
129
-                'mid' => ($hiXBin + $loXBin) / 2);
129
+                'mid' => ($hiXBin + $loXBin)/2);
130 130
             for ($j = 0; $j < $this->_nbins['y']; $j++) {
131
-                $loYBin = $this->_rangeLow['y'] + $j * $deltaY;
131
+                $loYBin = $this->_rangeLow['y'] + $j*$deltaY;
132 132
                 $hiYBin = $loYBin + $deltaY;
133 133
                 $yBin = array('low' => $loYBin, 'high' => $hiYBin,
134
-                    'mid' => ($hiYBin + $loYBin) / 2);
134
+                    'mid' => ($hiYBin + $loYBin)/2);
135 135
                 $bin = array('x' => $xBin, 'y' => $yBin);
136 136
                 $freq = 0;
137 137
                 for ($k = 0; $k < $nData; $k++) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             $out[] = implode($separator, $bins[$i]);
241 241
         }
242 242
 
243
-        return implode("\n", $out) . "\n";
243
+        return implode("\n", $out)."\n";
244 244
     }
245 245
 
246 246
     /**
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             && is_array($binOptions['low'])
301 301
             && is_array($binOptions['high'])
302 302
             && is_array($binOptions['nbins']));
303
-        if(!$barray) {
303
+        if (!$barray) {
304 304
             return false;
305 305
         }
306 306
         $low = $binOptions['low'];
Please login to merge, or discard this patch.
src/Histogram/Histogram4D.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         $this->_bins = array();
112 112
         $this->_stats = array('x' => new \HuasoFoundries\Math\Stats(), 'y' => new \HuasoFoundries\Math\Stats(), 'z' => new \HuasoFoundries\Math\Stats());
113 113
         $this->_statsMode = $statsMode;
114
-        $deltaX = ($this->_rangeHigh['x'] - $this->_rangeLow['x']) / $this->_nbins['x'];
115
-        $deltaY = ($this->_rangeHigh['y'] - $this->_rangeLow['y']) / $this->_nbins['y'];
116
-        $deltaZ = ($this->_rangeHigh['z'] - $this->_rangeLow['z']) / $this->_nbins['z'];
114
+        $deltaX = ($this->_rangeHigh['x'] - $this->_rangeLow['x'])/$this->_nbins['x'];
115
+        $deltaY = ($this->_rangeHigh['y'] - $this->_rangeLow['y'])/$this->_nbins['y'];
116
+        $deltaZ = ($this->_rangeHigh['z'] - $this->_rangeLow['z'])/$this->_nbins['z'];
117 117
         $data = $this->_histogramData();
118 118
         $dataX = $data['x'];
119 119
         $dataY = $data['y'];
@@ -122,20 +122,20 @@  discard block
 block discarded – undo
122 122
         $cumm = 0;
123 123
         $nData = count($dataX);
124 124
         for ($i = 0; $i < $this->_nbins['x']; $i++) {
125
-            $loXBin = $this->_rangeLow['x'] + $i * $deltaX;
125
+            $loXBin = $this->_rangeLow['x'] + $i*$deltaX;
126 126
             $hiXBin = $loXBin + $deltaX;
127 127
             $xBin = array('low' => $loXBin, 'high' => $hiXBin,
128
-                'mid' => ($hiXBin + $loXBin) / 2);
128
+                'mid' => ($hiXBin + $loXBin)/2);
129 129
             for ($j = 0; $j < $this->_nbins['y']; $j++) {
130
-                $loYBin = $this->_rangeLow['y'] + $j * $deltaY;
130
+                $loYBin = $this->_rangeLow['y'] + $j*$deltaY;
131 131
                 $hiYBin = $loYBin + $deltaY;
132 132
                 $yBin = array('low' => $loYBin, 'high' => $hiYBin,
133
-                    'mid' => ($hiYBin + $loYBin) / 2);
133
+                    'mid' => ($hiYBin + $loYBin)/2);
134 134
                 for ($m = 0; $m < $this->_nbins['z']; $m++) {
135
-                    $loZBin = $this->_rangeLow['z'] + $m * $deltaZ;
135
+                    $loZBin = $this->_rangeLow['z'] + $m*$deltaZ;
136 136
                     $hiZBin = $loZBin + $deltaZ;
137 137
                     $zBin = array('low' => $loZBin, 'high' => $hiZBin,
138
-                        'mid' => ($hiZBin + $loZBin) / 2);
138
+                        'mid' => ($hiZBin + $loZBin)/2);
139 139
                     $bin = array('x' => $xBin, 'y' => $yBin, 'z' => $zBin);
140 140
                     $freq = 0;
141 141
                     for ($k = 0; $k < $nData; $k++) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
             $out[] = implode($separator, $bins[$i]);
258 258
         }
259 259
 
260
-        return implode("\n", $out) . "\n";
260
+        return implode("\n", $out)."\n";
261 261
     }
262 262
 
263 263
     /**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             && is_array($binOptions['high'])
320 320
             && is_array($binOptions['nbins']));
321 321
 
322
-        if(!$barray) {
322
+        if (!$barray) {
323 323
             return false;
324 324
         }
325 325
         $low = $binOptions['low'];
Please login to merge, or discard this patch.
src/Histogram/Printer/Text.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
         $out = ($this->_hist->_type == \HuasoFoundries\Histogram\Histogram::HISTOGRAM_CUMMULATIVE) ? "Cummulative Frequency" : "Histogram";
48 48
         $out .= "\n\tNumber of bins: {$binopts['nbins']}\n";
49 49
         $out .= "\tPlot range: [{$binopts['rangeLow']}, {$binopts['rangeHigh']}]\n";
50
-        $out .= "\tData range: [" . min($hdata) . ", " . max($hdata) . "]\n";
51
-        $out .= "\tOriginal data range: [" . min($data) . ", " . max($data) . "]\n";
50
+        $out .= "\tData range: [".min($hdata).", ".max($hdata)."]\n";
51
+        $out .= "\tOriginal data range: [".min($data).", ".max($data)."]\n";
52 52
         $out .= "BIN (FREQUENCY) ASCII_BAR (%)\n";
53 53
         foreach ($bins as $bin => $freq) {
54 54
             $out .= sprintf($fmt, $bin, $freq, $this->_bar($freq, $maxfreq, $total));
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
     public function _bar($freq, $maxfreq, $total)
109 109
     {
110 110
 
111
-        $fact = floatval(($maxfreq > 40) ? 40 / $maxfreq : 1);
112
-        $niter = round($freq * $fact);
111
+        $fact = floatval(($maxfreq > 40) ? 40/$maxfreq : 1);
112
+        $niter = round($freq*$fact);
113 113
         $out = "";
114 114
         for ($i = 0; $i < $niter; $i++) {
115 115
             $out .= "*";
116 116
         }
117 117
 
118
-        return $out . sprintf(" (%.1f%%)", $freq / $total * 100);
118
+        return $out.sprintf(" (%.1f%%)", $freq/$total*100);
119 119
 
120 120
     }
121 121
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
         $out = '';
134 134
         foreach ($stats as $name => $value) {
135 135
             if (is_array($value)) {
136
-                $out .= $prefix . $name . ":\n";
137
-                $out .= $this->_printStats($value, $prefix . "\t");
136
+                $out .= $prefix.$name.":\n";
137
+                $out .= $this->_printStats($value, $prefix."\t");
138 138
             } else {
139 139
                 $out .= "{$prefix}{$name}: $value\n";
140 140
             }
Please login to merge, or discard this patch.
src/Math/Stats.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $this->_nullOption = $nullOption;
183 183
             return true;
184 184
         } else {
185
-            throw new \PEAR_Exception('invalid null handling option expecting: ' .
185
+            throw new \PEAR_Exception('invalid null handling option expecting: '.
186 186
                 'STATS_REJECT_NULL, STATS_IGNORE_NULL or STATS_USE_NULL_AS_ZERO');
187 187
         }
188 188
     }
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
         $arr = array();
218 218
         if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) {
219 219
             foreach ($this->_data as $val => $freq) {
220
-                $newval = ($val - $mean) / $std;
220
+                $newval = ($val - $mean)/$std;
221 221
                 $arr["$newval"] = $freq;
222 222
             }
223 223
         } else {
224 224
             foreach ($this->_data as $val) {
225
-                $newval = ($val - $mean) / $std;
225
+                $newval = ($val - $mean)/$std;
226 226
                 $arr[] = $newval;
227 227
             }
228 228
         }
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
         $sumN = 0;
497 497
         if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) {
498 498
             foreach ($this->_data as $val => $freq) {
499
-                $sumN += $freq * pow((double) $val, (double) $n);
499
+                $sumN += $freq*pow((double)$val, (double)$n);
500 500
             }
501 501
         } else {
502 502
             foreach ($this->_data as $val) {
503
-                $sumN += pow((double) $val, (double) $n);
503
+                $sumN += pow((double)$val, (double)$n);
504 504
             }
505 505
         }
506 506
         return $sumN;
@@ -555,8 +555,8 @@  discard block
 block discarded – undo
555 555
                 if ($val == 0) {
556 556
                     return 0.0;
557 557
                 }
558
-                $prodN *= $freq * pow((double) $val, (double) $n);
559
-                if ($prodN > 10000 * $n) {
558
+                $prodN *= $freq*pow((double)$val, (double)$n);
559
+                if ($prodN > 10000*$n) {
560 560
                     $partial[] = $prodN;
561 561
                     $prodN = 1.0;
562 562
                 }
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
                 if ($val == 0) {
567 567
                     return 0.0;
568 568
                 }
569
-                $prodN *= pow((double) $val, (double) $n);
570
-                if ($prodN > 10 * $n) {
569
+                $prodN *= pow((double)$val, (double)$n);
570
+                if ($prodN > 10*$n) {
571 571
                     $partial[] = $prodN;
572 572
                     $prodN = 1.0;
573 573
                 }
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
                 } catch (\PEAR_Exception $e) {
638 638
                     return $count;
639 639
                 }
640
-                $this->_calculatedValues['mean'] = $sum / $count;
640
+                $this->_calculatedValues['mean'] = $sum/$count;
641 641
             } catch (\PEAR_Exception $e) {
642 642
                 return $sum;
643 643
             }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
                 return $count;
848 848
             }
849 849
 
850
-            $this->_calculatedValues['skewness'] = ($sumdiff3 / ($count * pow($stDev, 3)));
850
+            $this->_calculatedValues['skewness'] = ($sumdiff3/($count*pow($stDev, 3)));
851 851
         }
852 852
         return $this->_calculatedValues['skewness'];
853 853
     }
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
                 return $count;
892 892
             }
893 893
 
894
-            $this->_calculatedValues['kurtosis'] = ($sumdiff4 / ($count * pow($stDev, 4))) - 3;
894
+            $this->_calculatedValues['kurtosis'] = ($sumdiff4/($count*pow($stDev, 4))) - 3;
895 895
         }
896 896
         return $this->_calculatedValues['kurtosis'];
897 897
     }
@@ -927,9 +927,9 @@  discard block
 block discarded – undo
927 927
                 return $n;
928 928
             }
929 929
 
930
-            $h = intval($n / 2);
931
-            if ($n % 2 == 0) {
932
-                $median = ($arr[$h] + $arr[$h - 1]) / 2;
930
+            $h = intval($n/2);
931
+            if ($n%2 == 0) {
932
+                $median = ($arr[$h] + $arr[$h - 1])/2;
933 933
             } else {
934 934
                 $median = $arr[$h];
935 935
             }
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
                 return $min;
1011 1011
             }
1012 1012
 
1013
-            $this->_calculatedValues['midrange'] = (($max + $min) / 2);
1013
+            $this->_calculatedValues['midrange'] = (($max + $min)/2);
1014 1014
         }
1015 1015
         return $this->_calculatedValues['midrange'];
1016 1016
     }
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
             if (is_array($prod)) {
1043 1043
                 $geomMean = 1.0;
1044 1044
                 foreach ($prod as $val) {
1045
-                    $geomMean *= pow($val, 1 / $count);
1045
+                    $geomMean *= pow($val, 1/$count);
1046 1046
                 }
1047 1047
                 $this->_calculatedValues['geometricMean'] = $geomMean;
1048 1048
             } else {
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
                 if ($prod < 0) {
1053 1053
                     throw new \PEAR_Exception('The product of the data set is negative, geometric mean undefined.');
1054 1054
                 }
1055
-                $this->_calculatedValues['geometricMean'] = pow($prod, 1 / $count);
1055
+                $this->_calculatedValues['geometricMean'] = pow($prod, 1/$count);
1056 1056
             }
1057 1057
         }
1058 1058
         return $this->_calculatedValues['geometricMean'];
@@ -1083,21 +1083,21 @@  discard block
 block discarded – undo
1083 1083
             if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) {
1084 1084
                 foreach ($this->_data as $val => $freq) {
1085 1085
                     if ($val == 0) {
1086
-                        throw new \PEAR_Exception('cannot calculate a ' .
1086
+                        throw new \PEAR_Exception('cannot calculate a '.
1087 1087
                             'harmonic mean with data values of zero.');
1088 1088
                     }
1089
-                    $invsum += $freq / $val;
1089
+                    $invsum += $freq/$val;
1090 1090
                 }
1091 1091
             } else {
1092 1092
                 foreach ($this->_data as $val) {
1093 1093
                     if ($val == 0) {
1094
-                        throw new \PEAR_Exception('cannot calculate a ' .
1094
+                        throw new \PEAR_Exception('cannot calculate a '.
1095 1095
                             'harmonic mean with data values of zero.');
1096 1096
                     }
1097
-                    $invsum += 1 / $val;
1097
+                    $invsum += 1/$val;
1098 1098
                 }
1099 1099
             }
1100
-            $this->_calculatedValues['harmonicMean'] = $count / $invsum;
1100
+            $this->_calculatedValues['harmonicMean'] = $count/$invsum;
1101 1101
         }
1102 1102
         return $this->_calculatedValues['harmonicMean'];
1103 1103
     }
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
             return $count;
1132 1132
         }
1133 1133
         if ($count == 0) {
1134
-            throw new \PEAR_Exception("Cannot calculate {$n}th sample moment, " .
1134
+            throw new \PEAR_Exception("Cannot calculate {$n}th sample moment, ".
1135 1135
                 'there are zero data entries');
1136 1136
         }
1137 1137
         try {
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
         } catch (\PEAR_Exception $e) {
1140 1140
             return $sum;
1141 1141
         }
1142
-        return ($sum / $count);
1142
+        return ($sum/$count);
1143 1143
     }
1144 1144
 
1145 1145
     /**
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
             return $count;
1169 1169
         }
1170 1170
         if ($count == 0) {
1171
-            throw new \PEAR_Exception("Cannot calculate {$n}th raw moment, " .
1171
+            throw new \PEAR_Exception("Cannot calculate {$n}th raw moment, ".
1172 1172
                 'there are zero data entries.');
1173 1173
         }
1174 1174
         try {
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
         } catch (\PEAR_Exception $e) {
1177 1177
             return $sum;
1178 1178
         }
1179
-        return ($sum / $count);
1179
+        return ($sum/$count);
1180 1180
     }
1181 1181
 
1182 1182
     /**
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
             }
1203 1203
 
1204 1204
             if ($mean == 0.0) {
1205
-                throw new \PEAR_Exception('cannot calculate the coefficient ' .
1205
+                throw new \PEAR_Exception('cannot calculate the coefficient '.
1206 1206
                     'of variation, mean of sample is zero');
1207 1207
             }
1208 1208
             try {
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
                 return $stDev;
1212 1212
             }
1213 1213
 
1214
-            $this->_calculatedValues['coeffOfVariation'] = $stDev / $mean;
1214
+            $this->_calculatedValues['coeffOfVariation'] = $stDev/$mean;
1215 1215
         }
1216 1216
         return $this->_calculatedValues['coeffOfVariation'];
1217 1217
     }
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
             } catch (\PEAR_Exception $e) {
1248 1248
                 return $stDev;
1249 1249
             }
1250
-            $this->_calculatedValues['stdErrorOfMean'] = $stDev / sqrt($count);
1250
+            $this->_calculatedValues['stdErrorOfMean'] = $stDev/sqrt($count);
1251 1251
         }
1252 1252
         return $this->_calculatedValues['stdErrorOfMean'];
1253 1253
     }
@@ -1358,10 +1358,10 @@  discard block
 block discarded – undo
1358 1358
                 }
1359 1359
             }
1360 1360
             if ($n == 0) {
1361
-                throw new \PEAR_Exception('error calculating interquartile mean, ' .
1361
+                throw new \PEAR_Exception('error calculating interquartile mean, '.
1362 1362
                     'empty interquartile range of values.');
1363 1363
             }
1364
-            $this->_calculatedValues['interquartileMean'] = $sum / $n;
1364
+            $this->_calculatedValues['interquartileMean'] = $sum/$n;
1365 1365
         }
1366 1366
         return $this->_calculatedValues['interquartileMean'];
1367 1367
     }
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
             } catch (\PEAR_Exception $e) {
1417 1417
                 return $iqr;
1418 1418
             }
1419
-            $this->_calculatedValues['quartileDeviation'] = $iqr / 2;
1419
+            $this->_calculatedValues['quartileDeviation'] = $iqr/2;
1420 1420
         }
1421 1421
         return $this->_calculatedValues['quartileDeviation'];
1422 1422
     }
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
             $q1 = $quart['25'];
1447 1447
             $d = $q3 - $q1;
1448 1448
             $s = $q3 + $q1;
1449
-            $this->_calculatedValues['quartileVariationCoefficient'] = 100 * $d / $s;
1449
+            $this->_calculatedValues['quartileVariationCoefficient'] = 100*$d/$s;
1450 1450
         }
1451 1451
         return $this->_calculatedValues['quartileVariationCoefficient'];
1452 1452
     }
@@ -1476,9 +1476,9 @@  discard block
 block discarded – undo
1476 1476
             $q3 = $quart['75'];
1477 1477
             $q2 = $quart['50'];
1478 1478
             $q1 = $quart['25'];
1479
-            $d = $q3 - 2 * $q2 + $q1;
1479
+            $d = $q3 - 2*$q2 + $q1;
1480 1480
             $s = $q3 - $q1;
1481
-            $this->_calculatedValues['quartileSkewnessCoefficient'] = $d / $s;
1481
+            $this->_calculatedValues['quartileSkewnessCoefficient'] = $d/$s;
1482 1482
         }
1483 1483
         return $this->_calculatedValues['quartileSkewnessCoefficient'];
1484 1484
     }
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
         } else {
1521 1521
             $data = &$this->_data;
1522 1522
         }
1523
-        $obsidx = $p * ($count + 1) / 100;
1523
+        $obsidx = $p*($count + 1)/100;
1524 1524
         if (intval($obsidx) == $obsidx) {
1525 1525
             return $data[($obsidx - 1)];
1526 1526
         } elseif ($obsidx < 1) {
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
         } else {
1531 1531
             $left = floor($obsidx - 1);
1532 1532
             $right = ceil($obsidx - 1);
1533
-            return ($data[$left] + $data[$right]) / 2;
1533
+            return ($data[$left] + $data[$right])/2;
1534 1534
         }
1535 1535
     }
1536 1536
 
@@ -1566,11 +1566,11 @@  discard block
 block discarded – undo
1566 1566
         $sdiff = 0;
1567 1567
         if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) {
1568 1568
             foreach ($this->_data as $val => $freq) {
1569
-                $sdiff += $freq * pow((double) ($val - $mean), (double) $power);
1569
+                $sdiff += $freq*pow((double)($val - $mean), (double)$power);
1570 1570
             }
1571 1571
         } else {
1572 1572
             foreach ($this->_data as $val) {
1573
-                $sdiff += pow((double) ($val - $mean), (double) $power);
1573
+                $sdiff += pow((double)($val - $mean), (double)$power);
1574 1574
             }
1575 1575
 
1576 1576
         }
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
         if ($count == 1) {
1608 1608
             throw new \PEAR_Exception('cannot calculate variance of a singe data point');
1609 1609
         }
1610
-        return ($sumdiff2 / ($count - 1));
1610
+        return ($sumdiff2/($count - 1));
1611 1611
     }
1612 1612
 
1613 1613
     /**
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
             return $count;
1638 1638
         }
1639 1639
 
1640
-        return $sumabsdev / $count;
1640
+        return $sumabsdev/$count;
1641 1641
     }
1642 1642
 
1643 1643
     /**
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
         $sdev = 0;
1663 1663
         if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) {
1664 1664
             foreach ($this->_data as $val => $freq) {
1665
-                $sdev += $freq * abs($val - $mean);
1665
+                $sdev += $freq*abs($val - $mean);
1666 1666
             }
1667 1667
         } else {
1668 1668
             foreach ($this->_data as $val) {
Please login to merge, or discard this patch.