Completed
Push — develop ( aa97bb...91573b )
by
unknown
09:37
created
src/PhpSpreadsheet/Calculation/Statistical.php 2 patches
Doc Comments   +6 added lines, -44 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @param p require p>0
132 132
      * @param q require q>0
133
-     * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
133
+     * @return double if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
134 134
      * @author Jaco van Kooten
135 135
      */
136 136
     private static function logBeta($p, $q)
@@ -152,6 +152,8 @@  discard block
 block discarded – undo
152 152
      * Evaluates of continued fraction part of incomplete beta function.
153 153
      * Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
154 154
      * @author Jaco van Kooten
155
+     * @param double $p
156
+     * @param double $q
155 157
      */
156 158
     private static function betaFraction($x, $p, $q)
157 159
     {
@@ -708,7 +710,6 @@  discard block
 block discarded – undo
708 710
      *
709 711
      * @access    public
710 712
      * @category Statistical Functions
711
-     * @param    mixed        $arg,...        Data values
712 713
      * @return    float
713 714
      */
714 715
     public static function AVEDEV()
@@ -757,7 +758,6 @@  discard block
 block discarded – undo
757 758
      *
758 759
      * @access    public
759 760
      * @category Statistical Functions
760
-     * @param    mixed        $arg,...        Data values
761 761
      * @return    float
762 762
      */
763 763
     public static function AVERAGE()
@@ -800,7 +800,6 @@  discard block
 block discarded – undo
800 800
      *
801 801
      * @access    public
802 802
      * @category Statistical Functions
803
-     * @param    mixed        $arg,...        Data values
804 803
      * @return    float
805 804
      */
806 805
     public static function AVERAGEA()
@@ -847,7 +846,6 @@  discard block
 block discarded – undo
847 846
      *
848 847
      * @access    public
849 848
      * @category Mathematical and Trigonometric Functions
850
-     * @param    mixed        $arg,...        Data values
851 849
      * @param    string        $condition        The criteria that defines which cells will be checked.
852 850
      * @param    mixed[]        $averageArgs    Data values
853 851
      * @return    float
@@ -892,7 +890,6 @@  discard block
 block discarded – undo
892 890
      * @param    float        $value            Value at which you want to evaluate the distribution
893 891
      * @param    float        $alpha            Parameter to the distribution
894 892
      * @param    float        $beta            Parameter to the distribution
895
-     * @param    boolean        $cumulative
896 893
      * @return    float
897 894
      *
898 895
      */
@@ -929,9 +926,8 @@  discard block
 block discarded – undo
929 926
      * @param    float        $probability    Probability at which you want to evaluate the distribution
930 927
      * @param    float        $alpha            Parameter to the distribution
931 928
      * @param    float        $beta            Parameter to the distribution
932
-     * @param    float        $rMin            Minimum value
933
-     * @param    float        $rMax            Maximum value
934
-     * @param    boolean        $cumulative
929
+     * @param    integer        $rMin            Minimum value
930
+     * @param    integer        $rMax            Maximum value
935 931
      * @return    float
936 932
      *
937 933
      */
@@ -1180,7 +1176,6 @@  discard block
 block discarded – undo
1180 1176
      *
1181 1177
      * @access    public
1182 1178
      * @category Statistical Functions
1183
-     * @param    mixed        $arg,...        Data values
1184 1179
      * @return    int
1185 1180
      */
1186 1181
     public static function COUNT()
@@ -1214,7 +1209,6 @@  discard block
 block discarded – undo
1214 1209
      *
1215 1210
      * @access    public
1216 1211
      * @category Statistical Functions
1217
-     * @param    mixed        $arg,...        Data values
1218 1212
      * @return    int
1219 1213
      */
1220 1214
     public static function COUNTA()
@@ -1244,7 +1238,6 @@  discard block
 block discarded – undo
1244 1238
      *
1245 1239
      * @access    public
1246 1240
      * @category Statistical Functions
1247
-     * @param    mixed        $arg,...        Data values
1248 1241
      * @return    int
1249 1242
      */
1250 1243
     public static function COUNTBLANK()
@@ -1274,7 +1267,6 @@  discard block
 block discarded – undo
1274 1267
      *
1275 1268
      * @access    public
1276 1269
      * @category Statistical Functions
1277
-     * @param    mixed        $arg,...        Data values
1278 1270
      * @param    string        $condition        The criteria that defines which cells will be counted.
1279 1271
      * @return    int
1280 1272
      */
@@ -1462,7 +1454,6 @@  discard block
 block discarded – undo
1462 1454
      *
1463 1455
      * @access    public
1464 1456
      * @category Statistical Functions
1465
-     * @param    mixed        $arg,...        Data values
1466 1457
      * @return    float
1467 1458
      */
1468 1459
     public static function DEVSQ()
@@ -1744,7 +1735,6 @@  discard block
 block discarded – undo
1744 1735
      *
1745 1736
      * @access    public
1746 1737
      * @category Statistical Functions
1747
-     * @param    mixed        $arg,...        Data values
1748 1738
      * @return    float
1749 1739
      */
1750 1740
     public static function GEOMEAN()
@@ -1805,7 +1795,6 @@  discard block
 block discarded – undo
1805 1795
      *
1806 1796
      * @access    public
1807 1797
      * @category Statistical Functions
1808
-     * @param    mixed        $arg,...        Data values
1809 1798
      * @return    float
1810 1799
      */
1811 1800
     public static function HARMEAN()
@@ -1961,8 +1950,6 @@  discard block
 block discarded – undo
1961 1950
      *
1962 1951
      * @access    public
1963 1952
      * @category Statistical Functions
1964
-     * @param    mixed        $arg,...        Data values
1965
-     * @param    int            $entry            Position (ordered from the largest) in the array or range of data to return
1966 1953
      * @return    float
1967 1954
      *
1968 1955
      */
@@ -2187,7 +2174,6 @@  discard block
 block discarded – undo
2187 2174
      *
2188 2175
      * @access    public
2189 2176
      * @category Statistical Functions
2190
-     * @param    mixed        $arg,...        Data values
2191 2177
      * @return    float
2192 2178
      */
2193 2179
     public static function MAX()
@@ -2222,7 +2208,6 @@  discard block
 block discarded – undo
2222 2208
      *
2223 2209
      * @access    public
2224 2210
      * @category Statistical Functions
2225
-     * @param    mixed        $arg,...        Data values
2226 2211
      * @return    float
2227 2212
      */
2228 2213
     public static function MAXA()
@@ -2262,7 +2247,6 @@  discard block
 block discarded – undo
2262 2247
      *
2263 2248
      * @access    public
2264 2249
      * @category Mathematical and Trigonometric Functions
2265
-     * @param    mixed        $arg,...        Data values
2266 2250
      * @param    string        $condition        The criteria that defines which cells will be checked.
2267 2251
      * @return    float
2268 2252
      */
@@ -2302,7 +2286,6 @@  discard block
 block discarded – undo
2302 2286
      *
2303 2287
      * @access    public
2304 2288
      * @category Statistical Functions
2305
-     * @param    mixed        $arg,...        Data values
2306 2289
      * @return    float
2307 2290
      */
2308 2291
     public static function MEDIAN()
@@ -2346,7 +2329,6 @@  discard block
 block discarded – undo
2346 2329
      *
2347 2330
      * @access    public
2348 2331
      * @category Statistical Functions
2349
-     * @param    mixed        $arg,...        Data values
2350 2332
      * @return    float
2351 2333
      */
2352 2334
     public static function MIN()
@@ -2381,7 +2363,6 @@  discard block
 block discarded – undo
2381 2363
      *
2382 2364
      * @access    public
2383 2365
      * @category Statistical Functions
2384
-     * @param    mixed        $arg,...        Data values
2385 2366
      * @return    float
2386 2367
      */
2387 2368
     public static function MINA()
@@ -2421,7 +2402,6 @@  discard block
 block discarded – undo
2421 2402
      *
2422 2403
      * @access    public
2423 2404
      * @category Mathematical and Trigonometric Functions
2424
-     * @param    mixed        $arg,...        Data values
2425 2405
      * @param    string        $condition        The criteria that defines which cells will be checked.
2426 2406
      * @return    float
2427 2407
      */
@@ -2499,7 +2479,6 @@  discard block
 block discarded – undo
2499 2479
      *
2500 2480
      * @access    public
2501 2481
      * @category Statistical Functions
2502
-     * @param    mixed        $arg,...        Data values
2503 2482
      * @return    float
2504 2483
      */
2505 2484
     public static function MODE()
@@ -2604,9 +2583,9 @@  discard block
 block discarded – undo
2604 2583
      *
2605 2584
      * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.
2606 2585
      *
2607
-     * @param    float        $value
2608 2586
      * @param    float        $mean        Mean Value
2609 2587
      * @param    float        $stdDev        Standard Deviation
2588
+     * @param double $probability
2610 2589
      * @return    float
2611 2590
      *
2612 2591
      */
@@ -2671,8 +2650,6 @@  discard block
 block discarded – undo
2671 2650
      *
2672 2651
      * @access    public
2673 2652
      * @category Statistical Functions
2674
-     * @param    mixed        $arg,...        Data values
2675
-     * @param    float        $entry            Percentile value in the range 0..1, inclusive.
2676 2653
      * @return    float
2677 2654
      */
2678 2655
     public static function PERCENTILE()
@@ -2836,8 +2813,6 @@  discard block
 block discarded – undo
2836 2813
      *
2837 2814
      * @access    public
2838 2815
      * @category Statistical Functions
2839
-     * @param    mixed        $arg,...        Data values
2840
-     * @param    int            $entry            Quartile value in the range 1..3, inclusive.
2841 2816
      * @return    float
2842 2817
      */
2843 2818
     public static function QUARTILE()
@@ -2999,8 +2974,6 @@  discard block
 block discarded – undo
2999 2974
      *
3000 2975
      * @access    public
3001 2976
      * @category Statistical Functions
3002
-     * @param    mixed        $arg,...        Data values
3003
-     * @param    int            $entry            Position (ordered from the smallest) in the array or range of data to return
3004 2977
      * @return    float
3005 2978
      */
3006 2979
     public static function SMALL()
@@ -3067,7 +3040,6 @@  discard block
 block discarded – undo
3067 3040
      *
3068 3041
      * @access    public
3069 3042
      * @category Statistical Functions
3070
-     * @param    mixed        $arg,...        Data values
3071 3043
      * @return    float
3072 3044
      */
3073 3045
     public static function STDEV()
@@ -3115,7 +3087,6 @@  discard block
 block discarded – undo
3115 3087
      *
3116 3088
      * @access    public
3117 3089
      * @category Statistical Functions
3118
-     * @param    mixed        $arg,...        Data values
3119 3090
      * @return    float
3120 3091
      */
3121 3092
     public static function STDEVA()
@@ -3166,7 +3137,6 @@  discard block
 block discarded – undo
3166 3137
      *
3167 3138
      * @access    public
3168 3139
      * @category Statistical Functions
3169
-     * @param    mixed        $arg,...        Data values
3170 3140
      * @return    float
3171 3141
      */
3172 3142
     public static function STDEVP()
@@ -3212,7 +3182,6 @@  discard block
 block discarded – undo
3212 3182
      *
3213 3183
      * @access    public
3214 3184
      * @category Statistical Functions
3215
-     * @param    mixed        $arg,...        Data values
3216 3185
      * @return    float
3217 3186
      */
3218 3187
     public static function STDEVPA()
@@ -3445,8 +3414,6 @@  discard block
 block discarded – undo
3445 3414
      *
3446 3415
      * @access    public
3447 3416
      * @category Statistical Functions
3448
-     * @param    mixed        $arg,...        Data values
3449
-     * @param    float        $discard        Percentage to discard
3450 3417
      * @return    float
3451 3418
      */
3452 3419
     public static function TRIMMEAN()
@@ -3489,7 +3456,6 @@  discard block
 block discarded – undo
3489 3456
      *
3490 3457
      * @access    public
3491 3458
      * @category Statistical Functions
3492
-     * @param    mixed        $arg,...        Data values
3493 3459
      * @return    float
3494 3460
      */
3495 3461
     public static function VARFunc()
@@ -3532,7 +3498,6 @@  discard block
 block discarded – undo
3532 3498
      *
3533 3499
      * @access    public
3534 3500
      * @category Statistical Functions
3535
-     * @param    mixed        $arg,...        Data values
3536 3501
      * @return    float
3537 3502
      */
3538 3503
     public static function VARA()
@@ -3584,7 +3549,6 @@  discard block
 block discarded – undo
3584 3549
      *
3585 3550
      * @access    public
3586 3551
      * @category Statistical Functions
3587
-     * @param    mixed        $arg,...        Data values
3588 3552
      * @return    float
3589 3553
      */
3590 3554
     public static function VARP()
@@ -3628,7 +3592,6 @@  discard block
 block discarded – undo
3628 3592
      *
3629 3593
      * @access    public
3630 3594
      * @category Statistical Functions
3631
-     * @param    mixed        $arg,...        Data values
3632 3595
      * @return    float
3633 3596
      */
3634 3597
     public static function VARPA()
@@ -3714,7 +3677,6 @@  discard block
 block discarded – undo
3714 3677
      * @param    float        $dataSet
3715 3678
      * @param    float        $m0        Alpha Parameter
3716 3679
      * @param    float        $sigma    Beta Parameter
3717
-     * @param    boolean        $cumulative
3718 3680
      * @return    float
3719 3681
      *
3720 3682
      */
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
         $frac = $h;
168 168
         $m     = 1;
169 169
         $delta = 0.0;
170
-        while ($m <= MAX_ITERATIONS && abs($delta-1.0) > PRECISION) {
170
+        while ($m <= MAX_ITERATIONS && abs($delta - 1.0) > PRECISION) {
171 171
             $m2 = 2 * $m;
172 172
             // even index for d
173
-            $d = $m * ($q - $m) * $x / ( ($p_minus + $m2) * ($p + $m2));
173
+            $d = $m * ($q - $m) * $x / (($p_minus + $m2) * ($p + $m2));
174 174
             $h = 1.0 + $d * $h;
175 175
             if (abs($h) < XMININ) {
176 176
                 $h = XMININ;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             341747634550.7377132798597,
315 315
             446315818741.9713286462081
316 316
         );
317
-        static $lg_c  = array(
317
+        static $lg_c = array(
318 318
             -0.001910444077728,
319 319
             8.4171387781295e-4,
320 320
             -5.952379913043012e-4,
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
     {
429 429
         static $max = 32;
430 430
         $summer = 0;
431
-        for ($n=0; $n<=$max; ++$n) {
431
+        for ($n = 0; $n <= $max; ++$n) {
432 432
             $divisor = $a;
433
-            for ($i=1; $i<=$n; ++$i) {
433
+            for ($i = 1; $i <= $n; ++$i) {
434 434
                 $divisor *= ($a + $i);
435 435
             }
436 436
             $summer += (pow($x, $n) / $divisor);
437 437
         }
438
-        return pow($x, $a) * exp(0-$x) * $summer;
438
+        return pow($x, $a) * exp(0 - $x) * $summer;
439 439
     }
440 440
 
441 441
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
         $tmp -= ($x + 0.5) * log($tmp);
464 464
 
465 465
         $summer = $p0;
466
-        for ($j=1; $j<=6; ++$j) {
466
+        for ($j = 1; $j <= 6; ++$j) {
467 467
             $summer += ($p[$j] / ++$y);
468 468
         }
469 469
         return exp(0 - $tmp + log(SQRT2PI * $summer / $x));
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
         );
528 528
 
529 529
         //    Define lower and upper region break-points.
530
-        $p_low = 0.02425;            //Use lower region approx. below this
531
-        $p_high = 1 - $p_low;        //Use upper region approx. above this
530
+        $p_low = 0.02425; //Use lower region approx. below this
531
+        $p_high = 1 - $p_low; //Use upper region approx. above this
532 532
 
533 533
         if (0 < $p && $p < $p_low) {
534 534
             //    Rational approximation for lower region.
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
             if (!is_numeric($arg)) {
869 869
                 $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
870 870
             }
871
-            $testCondition = '='.$arg.$condition;
871
+            $testCondition = '=' . $arg . $condition;
872 872
             if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
873 873
                 if ((is_null($returnValue)) || ($arg > $returnValue)) {
874 874
                     $returnValue += $arg;
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
                     }
1016 1016
                     return $summer;
1017 1017
                 } else {
1018
-                    return MathTrig::COMBIN($trials, $value) * pow($probability, $value) * pow(1 - $probability, $trials - $value) ;
1018
+                    return MathTrig::COMBIN($trials, $value) * pow($probability, $value) * pow(1 - $probability, $trials - $value);
1019 1019
                 }
1020 1020
             }
1021 1021
         }
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
                 }
1048 1048
                 return Functions::NAN();
1049 1049
             }
1050
-            return 1 - (self::incompleteGamma($degrees/2, $value/2) / self::gamma($degrees/2));
1050
+            return 1 - (self::incompleteGamma($degrees / 2, $value / 2) / self::gamma($degrees / 2));
1051 1051
         }
1052 1052
         return Functions::VALUE();
1053 1053
     }
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
             $xHi = 0;
1073 1073
 
1074 1074
             $x = $xNew = 1;
1075
-            $dx    = 1;
1075
+            $dx = 1;
1076 1076
             $i = 0;
1077 1077
 
1078 1078
             while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
             if (!is_numeric($arg)) {
1290 1290
                 $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
1291 1291
             }
1292
-            $testCondition = '='.$arg.$condition;
1292
+            $testCondition = '=' . $arg . $condition;
1293 1293
             if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
1294 1294
                 // Is it a value within our criteria
1295 1295
                 ++$returnValue;
@@ -1517,9 +1517,9 @@  discard block
 block discarded – undo
1517 1517
      */
1518 1518
     public static function EXPONDIST($value, $lambda, $cumulative)
1519 1519
     {
1520
-        $value    = Functions::flattenSingleValue($value);
1521
-        $lambda    = Functions::flattenSingleValue($lambda);
1522
-        $cumulative    = Functions::flattenSingleValue($cumulative);
1520
+        $value = Functions::flattenSingleValue($value);
1521
+        $lambda = Functions::flattenSingleValue($lambda);
1522
+        $cumulative = Functions::flattenSingleValue($cumulative);
1523 1523
 
1524 1524
         if ((is_numeric($value)) && (is_numeric($lambda))) {
1525 1525
             if (($value < 0) || ($lambda < 0)) {
@@ -1527,9 +1527,9 @@  discard block
 block discarded – undo
1527 1527
             }
1528 1528
             if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
1529 1529
                 if ($cumulative) {
1530
-                    return 1 - exp(0-$value*$lambda);
1530
+                    return 1 - exp(0 - $value * $lambda);
1531 1531
                 } else {
1532
-                    return $lambda * exp(0-$value*$lambda);
1532
+                    return $lambda * exp(0 - $value * $lambda);
1533 1533
                 }
1534 1534
             }
1535 1535
         }
@@ -1549,13 +1549,13 @@  discard block
 block discarded – undo
1549 1549
      */
1550 1550
     public static function FISHER($value)
1551 1551
     {
1552
-        $value    = Functions::flattenSingleValue($value);
1552
+        $value = Functions::flattenSingleValue($value);
1553 1553
 
1554 1554
         if (is_numeric($value)) {
1555 1555
             if (($value <= -1) || ($value >= 1)) {
1556 1556
                 return Functions::NAN();
1557 1557
             }
1558
-            return 0.5 * log((1+$value)/(1-$value));
1558
+            return 0.5 * log((1 + $value) / (1 - $value));
1559 1559
         }
1560 1560
         return Functions::VALUE();
1561 1561
     }
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
      */
1574 1574
     public static function FISHERINV($value)
1575 1575
     {
1576
-        $value    = Functions::flattenSingleValue($value);
1576
+        $value = Functions::flattenSingleValue($value);
1577 1577
 
1578 1578
         if (is_numeric($value)) {
1579 1579
             return (exp(2 * $value) - 1) / (exp(2 * $value) + 1);
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
      */
1595 1595
     public static function FORECAST($xValue, $yValues, $xValues)
1596 1596
     {
1597
-        $xValue    = Functions::flattenSingleValue($xValue);
1597
+        $xValue = Functions::flattenSingleValue($xValue);
1598 1598
         if (!is_numeric($xValue)) {
1599 1599
             return Functions::VALUE();
1600 1600
         } elseif (!self::checkTrendArrays($yValues, $xValues)) {
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
                 if ($cumulative) {
1641 1641
                     return self::incompleteGamma($a, $value / $b) / self::gamma($a);
1642 1642
                 } else {
1643
-                    return (1 / (pow($b, $a) * self::gamma($a))) * pow($value, $a-1) * exp(0-($value / $b));
1643
+                    return (1 / (pow($b, $a) * self::gamma($a))) * pow($value, $a - 1) * exp(0 - ($value / $b));
1644 1644
                 }
1645 1645
             }
1646 1646
         }
@@ -1720,7 +1720,7 @@  discard block
 block discarded – undo
1720 1720
      */
1721 1721
     public static function GAMMALN($value)
1722 1722
     {
1723
-        $value    = Functions::flattenSingleValue($value);
1723
+        $value = Functions::flattenSingleValue($value);
1724 1724
 
1725 1725
         if (is_numeric($value)) {
1726 1726
             if ($value <= 0) {
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 
1754 1754
         $aMean = MathTrig::PRODUCT($aArgs);
1755 1755
         if (is_numeric($aMean) && ($aMean > 0)) {
1756
-            $aCount = self::COUNT($aArgs) ;
1756
+            $aCount = self::COUNT($aArgs);
1757 1757
             if (self::MIN($aArgs) > 0) {
1758 1758
                 return pow($aMean, (1 / $aCount));
1759 1759
             }
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 
1944 1944
             // Return
1945 1945
             if ($count > 3) {
1946
-                return $summer * ($count * ($count+1) / (($count-1) * ($count-2) * ($count-3))) - (3 * pow($count-1, 2) / (($count-2) * ($count-3)));
1946
+                return $summer * ($count * ($count + 1) / (($count - 1) * ($count - 2) * ($count - 3))) - (3 * pow($count - 1, 2) / (($count - 2) * ($count - 3)));
1947 1947
             }
1948 1948
         }
1949 1949
         return Functions::DIV0();
@@ -2281,7 +2281,7 @@  discard block
 block discarded – undo
2281 2281
             if (!is_numeric($arg)) {
2282 2282
                 $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
2283 2283
             }
2284
-            $testCondition = '='.$arg.$condition;
2284
+            $testCondition = '=' . $arg . $condition;
2285 2285
             if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
2286 2286
                 if ((is_null($returnValue)) || ($arg > $returnValue)) {
2287 2287
                     $returnValue = $arg;
@@ -2440,7 +2440,7 @@  discard block
 block discarded – undo
2440 2440
             if (!is_numeric($arg)) {
2441 2441
                 $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
2442 2442
             }
2443
-            $testCondition = '='.$arg.$condition;
2443
+            $testCondition = '=' . $arg . $condition;
2444 2444
             if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
2445 2445
                 if ((is_null($returnValue)) || ($arg < $returnValue)) {
2446 2446
                     $returnValue = $arg;
@@ -2697,14 +2697,14 @@  discard block
 block discarded – undo
2697 2697
             if ($mValueCount > 0) {
2698 2698
                 sort($mArgs);
2699 2699
                 $count = self::COUNT($mArgs);
2700
-                $index = $entry * ($count-1);
2700
+                $index = $entry * ($count - 1);
2701 2701
                 $iBase = floor($index);
2702 2702
                 if ($index == $iBase) {
2703 2703
                     return $mArgs[$index];
2704 2704
                 } else {
2705 2705
                     $iNext = $iBase + 1;
2706 2706
                     $iProportion = $index - $iBase;
2707
-                    return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion) ;
2707
+                    return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion);
2708 2708
                 }
2709 2709
             }
2710 2710
         }
@@ -2816,9 +2816,9 @@  discard block
 block discarded – undo
2816 2816
                     for ($i = 0; $i <= floor($value); ++$i) {
2817 2817
                         $summer += pow($mean, $i) / MathTrig::FACT($i);
2818 2818
                     }
2819
-                    return exp(0-$mean) * $summer;
2819
+                    return exp(0 - $mean) * $summer;
2820 2820
                 } else {
2821
-                    return (exp(0-$mean) * pow($mean, $value)) / MathTrig::FACT($value);
2821
+                    return (exp(0 - $mean) * pow($mean, $value)) / MathTrig::FACT($value);
2822 2822
                 }
2823 2823
             }
2824 2824
         }
@@ -2954,7 +2954,7 @@  discard block
 block discarded – undo
2954 2954
         }
2955 2955
 
2956 2956
         if ($count > 2) {
2957
-            return $summer * ($count / (($count-1) * ($count-2)));
2957
+            return $summer * ($count / (($count - 1) * ($count - 2)));
2958 2958
         }
2959 2959
         return Functions::DIV0();
2960 2960
     }
@@ -3050,7 +3050,7 @@  discard block
 block discarded – undo
3050 3050
             if ($stdDev <= 0) {
3051 3051
                 return Functions::NAN();
3052 3052
             }
3053
-            return ($value - $mean) / $stdDev ;
3053
+            return ($value - $mean) / $stdDev;
3054 3054
         }
3055 3055
         return Functions::VALUE();
3056 3056
     }
@@ -3294,7 +3294,7 @@  discard block
 block discarded – undo
3294 3294
     public static function TDIST($value, $degrees, $tails)
3295 3295
     {
3296 3296
         $value        = Functions::flattenSingleValue($value);
3297
-        $degrees    = floor(Functions::flattenSingleValue($degrees));
3297
+        $degrees = floor(Functions::flattenSingleValue($degrees));
3298 3298
         $tails        = floor(Functions::flattenSingleValue($tails));
3299 3299
 
3300 3300
         if ((is_numeric($value)) && (is_numeric($degrees)) && (is_numeric($tails))) {
@@ -3364,7 +3364,7 @@  discard block
 block discarded – undo
3364 3364
             $xHi = 0;
3365 3365
 
3366 3366
             $x = $xNew = 1;
3367
-            $dx    = 1;
3367
+            $dx = 1;
3368 3368
             $i = 0;
3369 3369
 
3370 3370
             while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
@@ -3469,7 +3469,7 @@  discard block
 block discarded – undo
3469 3469
             }
3470 3470
             $discard = floor(self::COUNT($mArgs) * $percent / 2);
3471 3471
             sort($mArgs);
3472
-            for ($i=0; $i < $discard; ++$i) {
3472
+            for ($i = 0; $i < $discard; ++$i) {
3473 3473
                 array_pop($mArgs);
3474 3474
                 array_shift($mArgs);
3475 3475
             }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * CHARACTER
57 57
      *
58 58
      * @param    string    $character    Value
59
-     * @return    int
59
+     * @return    string
60 60
      */
61 61
     public static function CHARACTER($character)
62 62
     {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      * This function converts a number to text using currency format, with the decimals rounded to the specified place.
187 187
      * The format used is $#,##0.00_);($#,##0.00)..
188 188
      *
189
-     * @param    float    $value            The value to format
189
+     * @param    integer    $value            The value to format
190 190
      * @param    int        $decimals        The number of digits to display to the right of the decimal point.
191 191
      *                                    If decimals is negative, number is rounded to the left of the decimal point.
192 192
      *                                    If you omit decimals, it is assumed to be 2
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
      * @param    mixed        $value    Value to check
300 300
      * @param    integer        $decimals
301 301
      * @param    boolean        $no_commas
302
-     * @return    boolean
302
+     * @return    string
303 303
      */
304 304
     public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false)
305 305
     {
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      * STRINGLENGTH
419 419
      *
420 420
      * @param    string    $value    Value
421
-     * @return    string
421
+     * @return    integer
422 422
      */
423 423
     public static function STRINGLENGTH($value = '')
424 424
     {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
      * RETURNSTRING
572 572
      *
573 573
      * @param    mixed    $testValue    Value to check
574
-     * @return    boolean
574
+     * @return    string|null
575 575
      */
576 576
     public static function RETURNSTRING($testValue = '')
577 577
     {
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
      *
590 590
      * @param    mixed    $value    Value to check
591 591
      * @param    string    $format    Format mask to use
592
-     * @return    boolean
592
+     * @return    string
593 593
      */
594 594
     public static function TEXTFORMAT($value, $format)
595 595
     {
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 
34 34
     private static function unicodeToOrd($c)
35 35
     {
36
-        if (ord($c{0}) >=0 && ord($c{0}) <= 127) {
36
+        if (ord($c{0}) >= 0 && ord($c{0}) <= 127) {
37 37
             return ord($c{0});
38 38
         } elseif (ord($c{0}) >= 192 && ord($c{0}) <= 223) {
39
-            return (ord($c{0})-192)*64 + (ord($c{1})-128);
39
+            return (ord($c{0}) - 192) * 64 + (ord($c{1}) - 128);
40 40
         } elseif (ord($c{0}) >= 224 && ord($c{0}) <= 239) {
41
-            return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
41
+            return (ord($c{0}) - 224) * 4096 + (ord($c{1}) - 128) * 64 + (ord($c{2}) - 128);
42 42
         } elseif (ord($c{0}) >= 240 && ord($c{0}) <= 247) {
43
-            return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
43
+            return (ord($c{0}) - 240) * 262144 + (ord($c{1}) - 128) * 4096 + (ord($c{2}) - 128) * 64 + (ord($c{3}) - 128);
44 44
         } elseif (ord($c{0}) >= 248 && ord($c{0}) <= 251) {
45
-            return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
45
+            return (ord($c{0}) - 248) * 16777216 + (ord($c{1}) - 128) * 262144 + (ord($c{2}) - 128) * 4096 + (ord($c{3}) - 128) * 64 + (ord($c{4}) - 128);
46 46
         } elseif (ord($c{0}) >= 252 && ord($c{0}) <= 253) {
47
-            return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
47
+            return (ord($c{0}) - 252) * 1073741824 + (ord($c{1}) - 128) * 16777216 + (ord($c{2}) - 128) * 262144 + (ord($c{3}) - 128) * 4096 + (ord($c{4}) - 128) * 64 + (ord($c{5}) - 128);
48 48
         } elseif (ord($c{0}) >= 254 && ord($c{0}) <= 255) {
49 49
             // error
50 50
             return Functions::VALUE();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         }
68 68
 
69 69
         if (function_exists('mb_convert_encoding')) {
70
-            return mb_convert_encoding('&#'.intval($character).';', 'UTF-8', 'HTML-ENTITIES');
70
+            return mb_convert_encoding('&#' . intval($character) . ';', 'UTF-8', 'HTML-ENTITIES');
71 71
         } else {
72 72
             return chr(intval($character));
73 73
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function TRIMNONPRINTABLE($stringValue = '')
84 84
     {
85
-        $stringValue    = Functions::flattenSingleValue($stringValue);
85
+        $stringValue = Functions::flattenSingleValue($stringValue);
86 86
 
87 87
         if (is_bool($stringValue)) {
88 88
             return ($stringValue) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if (($characters === null) || ($characters === '')) {
131 131
             return Functions::VALUE();
132 132
         }
133
-        $characters    = Functions::flattenSingleValue($characters);
133
+        $characters = Functions::flattenSingleValue($characters);
134 134
         if (is_bool($characters)) {
135 135
             if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
136 136
                 $characters = (int) $characters;
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
      */
195 195
     public static function DOLLAR($value = 0, $decimals = 2)
196 196
     {
197
-        $value        = Functions::flattenSingleValue($value);
198
-        $decimals    = is_null($decimals) ? 0 : Functions::flattenSingleValue($decimals);
197
+        $value = Functions::flattenSingleValue($value);
198
+        $decimals = is_null($decimals) ? 0 : Functions::flattenSingleValue($decimals);
199 199
 
200 200
         // Validate parameters
201 201
         if (!is_numeric($value) || !is_numeric($decimals)) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         } else {
210 210
             $round = pow(10, abs($decimals));
211 211
             if ($value < 0) {
212
-                $round = 0-$round;
212
+                $round = 0 - $round;
213 213
             }
214 214
             $value = MathTrig::MROUND($value, $round);
215 215
         }
@@ -512,10 +512,10 @@  discard block
 block discarded – undo
512 512
         $chars   = Functions::flattenSingleValue($chars);
513 513
         $newText = Functions::flattenSingleValue($newText);
514 514
 
515
-        $left = self::LEFT($oldText, $start-1);
516
-        $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText)-($start+$chars)+1);
515
+        $left = self::LEFT($oldText, $start - 1);
516
+        $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText) - ($start + $chars) + 1);
517 517
 
518
-        return $left.$newText.$right;
518
+        return $left . $newText . $right;
519 519
     }
520 520
 
521 521
 
@@ -545,9 +545,9 @@  discard block
 block discarded – undo
545 545
             $pos = -1;
546 546
             while ($instance > 0) {
547 547
                 if (function_exists('mb_strpos')) {
548
-                    $pos = mb_strpos($text, $fromText, $pos+1, 'UTF-8');
548
+                    $pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8');
549 549
                 } else {
550
-                    $pos = strpos($text, $fromText, $pos+1);
550
+                    $pos = strpos($text, $fromText, $pos + 1);
551 551
                 }
552 552
                 if ($pos === false) {
553 553
                     break;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Cell.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      *    Send notification to the cache controller
95 95
      *
96
-     *    @return void
96
+     *    @return Cell
97 97
      **/
98 98
     public function notifyCacheController()
99 99
     {
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
      *    Coordinate from string
581 581
      *
582 582
      *    @param    string    $pCoordinateString
583
-     *    @return    array    Array containing column and row (indexes 0 and 1)
583
+     *    @return    string[]    Array containing column and row (indexes 0 and 1)
584 584
      *    @throws    Exception
585 585
      */
586 586
     public static function coordinateFromString($pCoordinateString = 'A1')
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
      *    Calculate range boundaries
761 761
      *
762 762
      *    @param    string    $pRange        Cell range (e.g. A1:A1)
763
-     *    @return    array    Range coordinates array(Start Cell, End Cell)
763
+     *    @return    integer    Range coordinates array(Start Cell, End Cell)
764 764
      *                    where Start Cell and End Cell are arrays (Column ID, Row Number)
765 765
      */
766 766
     public static function getRangeBoundaries($pRange = 'A1:A1')
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         // Verify if cell is in range
574 574
         return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
575 575
                 ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow)
576
-               );
576
+                );
577 577
     }
578 578
 
579 579
     /**
@@ -845,11 +845,11 @@  discard block
 block discarded – undo
845 845
                 $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
846 846
             } elseif ($pColumnIndex < 702) {
847 847
                 $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
848
-                                              chr(65 + $pColumnIndex % 26);
848
+                                                chr(65 + $pColumnIndex % 26);
849 849
             } else {
850 850
                 $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
851
-                                              chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
852
-                                              chr(65 + $pColumnIndex % 26);
851
+                                                chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
852
+                                                chr(65 + $pColumnIndex % 26);
853 853
             }
854 854
         }
855 855
         return $_indexCache[$pColumnIndex];
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 //echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
292 292
                 $result = '#N/A';
293 293
                 throw new Calculation\Exception(
294
-                    $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
294
+                    $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage()
295 295
                 );
296 296
             }
297 297
 
@@ -586,14 +586,14 @@  discard block
 block discarded – undo
586 586
     public static function coordinateFromString($pCoordinateString = 'A1')
587 587
     {
588 588
         if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
589
-            return array($matches[1],$matches[2]);
589
+            return array($matches[1], $matches[2]);
590 590
         } elseif ((strpos($pCoordinateString, ':') !== false) || (strpos($pCoordinateString, ',') !== false)) {
591 591
             throw new Exception('Cell coordinate string can not be a range of cells');
592 592
         } elseif ($pCoordinateString == '') {
593 593
             throw new Exception('Cell coordinate can not be zero-length string');
594 594
         }
595 595
 
596
-        throw new Exception('Invalid cell coordinate '.$pCoordinateString);
596
+        throw new Exception('Invalid cell coordinate ' . $pCoordinateString);
597 597
     }
598 598
 
599 599
     /**
@@ -733,11 +733,11 @@  discard block
 block discarded – undo
733 733
 
734 734
         // Calculate range outer borders
735 735
         $rangeStart = self::coordinateFromString($rangeA);
736
-        $rangeEnd    = self::coordinateFromString($rangeB);
736
+        $rangeEnd = self::coordinateFromString($rangeB);
737 737
 
738 738
         // Translate column into index
739
-        $rangeStart[0]    = self::columnIndexFromString($rangeStart[0]);
740
-        $rangeEnd[0]    = self::columnIndexFromString($rangeEnd[0]);
739
+        $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
740
+        $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
741 741
 
742 742
         return array($rangeStart, $rangeEnd);
743 743
     }
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
         // Calculate range outer borders
754 754
         list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
755 755
 
756
-        return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
756
+        return array(($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1));
757 757
     }
758 758
 
759 759
     /**
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
             list($rangeA, $rangeB) = explode(':', $pRange);
781 781
         }
782 782
 
783
-        return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
783
+        return array(self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
784 784
     }
785 785
 
786 786
     /**
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
                 }
886 886
 
887 887
                 // Range...
888
-                list($rangeStart, $rangeEnd)    = $range;
888
+                list($rangeStart, $rangeEnd) = $range;
889 889
                 sscanf($rangeStart, '%[A-Z]%d', $startCol, $startRow);
890 890
                 sscanf($rangeEnd, '%[A-Z]%d', $endCol, $endRow);
891 891
                 ++$endCol;
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
                 // Loop cells
898 898
                 while ($currentCol != $endCol) {
899 899
                     while ($currentRow <= $endRow) {
900
-                        $returnValue[] = $currentCol.$currentRow;
900
+                        $returnValue[] = $currentCol . $currentRow;
901 901
                         ++$currentRow;
902 902
                     }
903 903
                     ++$currentCol;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/Axis.php 1 patch
Doc Comments   +1 added lines, -5 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     /**
333 333
      * Set Shadow Properties
334 334
      *
335
-     * @param int $shadow_presets
335
+     * @param int $sh_presets
336 336
      * @param string $sh_color_value
337 337
      * @param string $sh_color_type
338 338
      * @param string $sh_color_alpha
@@ -467,10 +467,6 @@  discard block
 block discarded – undo
467 467
     /**
468 468
      * Get Glow Property
469 469
      *
470
-     * @param float $size
471
-     * @param string $color_value
472
-     * @param int $color_alpha
473
-     * @param string $color_type
474 470
      */
475 471
     public function getShadowProperty($elements)
476 472
     {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/DataSeries.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     /**
181 181
      * Get Plot Grouping Type
182 182
      *
183
-     * @return string
183
+     * @return boolean
184 184
      */
185 185
     public function getPlotGrouping()
186 186
     {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     /**
203 203
      * Get Plot Direction
204 204
      *
205
-     * @return string
205
+     * @return boolean
206 206
      */
207 207
     public function getPlotDirection()
208 208
     {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     /**
345 345
      * Get Smooth Line
346 346
      *
347
-     * @return boolean
347
+     * @return string
348 348
      */
349 349
     public function getSmoothLine()
350 350
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
     const TYPE_PIECHART        = 'pieChart';
39 39
     const TYPE_PIECHART_3D     = 'pie3DChart';
40 40
     const TYPE_DOUGHTNUTCHART  = 'doughnutChart';
41
-    const TYPE_DONUTCHART      = self::TYPE_DOUGHTNUTCHART;    //    Synonym
41
+    const TYPE_DONUTCHART      = self::TYPE_DOUGHTNUTCHART; //    Synonym
42 42
     const TYPE_SCATTERCHART    = 'scatterChart';
43 43
     const TYPE_SURFACECHART    = 'surfaceChart';
44 44
     const TYPE_SURFACECHART_3D = 'surface3DChart';
45 45
     const TYPE_RADARCHART      = 'radarChart';
46 46
     const TYPE_BUBBLECHART     = 'bubbleChart';
47 47
     const TYPE_STOCKCHART      = 'stockChart';
48
-    const TYPE_CANDLECHART     = self::TYPE_STOCKCHART;       //    Synonym
48
+    const TYPE_CANDLECHART     = self::TYPE_STOCKCHART; //    Synonym
49 49
 
50 50
     const GROUPING_CLUSTERED       = 'clustered';
51 51
     const GROUPING_STACKED         = 'stacked';
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/DataSeriesValues.php 2 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,6 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     /**
84 84
      * Create a new DataSeriesValues object
85
+     * @param string $dataSource
85 86
      */
86 87
     public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = array(), $marker = null)
87 88
     {
@@ -211,7 +212,7 @@  discard block
 block discarded – undo
211 212
     /**
212 213
      * Identify if the Data Series is a multi-level or a simple series
213 214
      *
214
-     * @return    boolean
215
+     * @return    boolean|null
215 216
      */
216 217
     public function isMultiLevelSeries()
217 218
     {
@@ -224,7 +225,7 @@  discard block
 block discarded – undo
224 225
     /**
225 226
      * Return the level count of a multi-level Data Series
226 227
      *
227
-     * @return    boolean
228
+     * @return    integer
228 229
      */
229 230
     public function multiLevelCount()
230 231
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
             $calcEngine = \PHPExcel\Calculation::getInstance($worksheet->getParent());
294 294
             $newDataValues = \PHPExcel\Calculation::unwrapResult(
295 295
                 $calcEngine->_calculateFormulaValue(
296
-                    '='.$this->dataSource,
296
+                    '=' . $this->dataSource,
297 297
                     null,
298 298
                     $worksheet->getCell('A1')
299 299
                 )
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/Layout.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -176,6 +176,7 @@
 block discarded – undo
176 176
      * Set Layout Target
177 177
      *
178 178
      * @param Layout Target $value
179
+     * @param string $value
179 180
      * @return Layout
180 181
      */
181 182
     public function setLayoutTarget($value)
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/Properties.php 1 patch
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -116,11 +116,17 @@  discard block
 block discarded – undo
116 116
         SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22,
117 117
         SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
118 118
 
119
+    /**
120
+     * @param double $width
121
+     */
119 122
     protected function getExcelPointsWidth($width)
120 123
     {
121 124
         return $width * 12700;
122 125
     }
123 126
 
127
+    /**
128
+     * @param integer $angle
129
+     */
124 130
     protected function getExcelPointsAngle($angle)
125 131
     {
126 132
         return $angle * 60000;
@@ -131,6 +137,11 @@  discard block
 block discarded – undo
131 137
         return (string) 100 - $alpha . '000';
132 138
     }
133 139
 
140
+    /**
141
+     * @param string $color
142
+     * @param integer $alpha
143
+     * @param string $type
144
+     */
134 145
     protected function setColorProperties($color, $alpha, $type)
135 146
     {
136 147
         return array(
@@ -140,6 +151,9 @@  discard block
 block discarded – undo
140 151
         );
141 152
     }
142 153
 
154
+    /**
155
+     * @param string $array_kay_selector
156
+     */
143 157
     protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
144 158
     {
145 159
         $sizes = array(
@@ -157,6 +171,9 @@  discard block
 block discarded – undo
157 171
         return $sizes[$array_selector][$array_kay_selector];
158 172
     }
159 173
 
174
+    /**
175
+     * @param integer $shadow_presets_option
176
+     */
160 177
     protected function getShadowPresetsMap($shadow_presets_option)
161 178
     {
162 179
         $presets_options = array(
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/Renderer/JpGraph.php 2 patches
Doc Comments   +62 added lines patch added patch discarded remove patch
@@ -65,6 +65,9 @@  discard block
 block discarded – undo
65 65
     private static $plotMark = 0;
66 66
 
67 67
 
68
+    /**
69
+     * @param string $markerID
70
+     */
68 71
     private function formatPointMarker($seriesPlot, $markerID)
69 72
     {
70 73
         $plotMarkKeys = array_keys(self::$markSet);
@@ -93,6 +96,9 @@  discard block
 block discarded – undo
93 96
     }
94 97
 
95 98
 
99
+    /**
100
+     * @param integer $labelCount
101
+     */
96 102
     private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '')
97 103
     {
98 104
         $datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
@@ -123,6 +129,9 @@  discard block
 block discarded – undo
123 129
     }
124 130
 
125 131
 
132
+    /**
133
+     * @param integer $seriesCount
134
+     */
126 135
     private function percentageSumCalculation($groupID, $seriesCount)
127 136
     {
128 137
         //    Adjust our values to a percentage value across all series in the group
@@ -155,6 +164,9 @@  discard block
 block discarded – undo
155 164
     }
156 165
 
157 166
 
167
+    /**
168
+     * @param \PHPExcel\Chart\Title $captionElement
169
+     */
158 170
     private function getCaption($captionElement)
159 171
     {
160 172
         //    Read any caption
@@ -267,6 +279,9 @@  discard block
 block discarded – undo
267 279
     }
268 280
 
269 281
 
282
+    /**
283
+     * @param integer $groupID
284
+     */
270 285
     private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d')
271 286
     {
272 287
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -331,6 +346,9 @@  discard block
 block discarded – undo
331 346
     }
332 347
 
333 348
 
349
+    /**
350
+     * @param integer $groupID
351
+     */
334 352
     private function renderPlotBar($groupID, $dimensions = '2d')
335 353
     {
336 354
         $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
@@ -417,6 +435,10 @@  discard block
 block discarded – undo
417 435
     }
418 436
 
419 437
 
438
+    /**
439
+     * @param integer $groupID
440
+     * @param boolean $bubble
441
+     */
420 442
     private function renderPlotScatter($groupID, $bubble)
421 443
     {
422 444
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -463,6 +485,9 @@  discard block
 block discarded – undo
463 485
     }
464 486
 
465 487
 
488
+    /**
489
+     * @param integer $groupID
490
+     */
466 491
     private function renderPlotRadar($groupID)
467 492
     {
468 493
         $radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -502,6 +527,9 @@  discard block
 block discarded – undo
502 527
     }
503 528
 
504 529
 
530
+    /**
531
+     * @param integer $groupID
532
+     */
505 533
     private function renderPlotContour($groupID)
506 534
     {
507 535
         $contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -523,6 +551,9 @@  discard block
 block discarded – undo
523 551
     }
524 552
 
525 553
 
554
+    /**
555
+     * @param integer $groupID
556
+     */
526 557
     private function renderPlotStock($groupID)
527 558
     {
528 559
         $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
@@ -563,6 +594,9 @@  discard block
 block discarded – undo
563 594
     }
564 595
 
565 596
 
597
+    /**
598
+     * @param integer $groupCount
599
+     */
566 600
     private function renderAreaChart($groupCount, $dimensions = '2d')
567 601
     {
568 602
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
@@ -575,6 +609,9 @@  discard block
 block discarded – undo
575 609
     }
576 610
 
577 611
 
612
+    /**
613
+     * @param integer $groupCount
614
+     */
578 615
     private function renderLineChart($groupCount, $dimensions = '2d')
579 616
     {
580 617
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
@@ -587,6 +624,9 @@  discard block
 block discarded – undo
587 624
     }
588 625
 
589 626
 
627
+    /**
628
+     * @param integer $groupCount
629
+     */
590 630
     private function renderBarChart($groupCount, $dimensions = '2d')
591 631
     {
592 632
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
@@ -599,6 +639,9 @@  discard block
 block discarded – undo
599 639
     }
600 640
 
601 641
 
642
+    /**
643
+     * @param integer $groupCount
644
+     */
602 645
     private function renderScatterChart($groupCount)
603 646
     {
604 647
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
@@ -613,6 +656,9 @@  discard block
 block discarded – undo
613 656
     }
614 657
 
615 658
 
659
+    /**
660
+     * @param integer $groupCount
661
+     */
616 662
     private function renderBubbleChart($groupCount)
617 663
     {
618 664
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
@@ -625,6 +671,9 @@  discard block
 block discarded – undo
625 671
     }
626 672
 
627 673
 
674
+    /**
675
+     * @param integer $groupCount
676
+     */
628 677
     private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
629 678
     {
630 679
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie.php');
@@ -702,6 +751,9 @@  discard block
 block discarded – undo
702 751
     }
703 752
 
704 753
 
754
+    /**
755
+     * @param integer $groupCount
756
+     */
705 757
     private function renderRadarChart($groupCount)
706 758
     {
707 759
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php');
@@ -714,6 +766,9 @@  discard block
 block discarded – undo
714 766
     }
715 767
 
716 768
 
769
+    /**
770
+     * @param integer $groupCount
771
+     */
717 772
     private function renderStockChart($groupCount)
718 773
     {
719 774
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php');
@@ -726,6 +781,10 @@  discard block
 block discarded – undo
726 781
     }
727 782
 
728 783
 
784
+    /**
785
+     * @param integer $groupCount
786
+     * @param string|null $dimensions
787
+     */
729 788
     private function renderContourChart($groupCount, $dimensions)
730 789
     {
731 790
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php');
@@ -738,6 +797,9 @@  discard block
 block discarded – undo
738 797
     }
739 798
 
740 799
 
800
+    /**
801
+     * @param integer $groupCount
802
+     */
741 803
     private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
742 804
     {
743 805
         require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace PHPExcel\Chart\Renderer;
4 4
 
5
-require_once(\PHPExcel\Settings::getChartRendererPath().'/jpgraph.php');
5
+require_once(\PHPExcel\Settings::getChartRendererPath() . '/jpgraph.php');
6 6
 
7 7
 /**
8 8
  * PHPExcel_Chart_Renderer_jpgraph
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
  */
32 32
 class JpGraph
33 33
 {
34
-    private static $width    = 640;
34
+    private static $width = 640;
35 35
 
36 36
     private static $height    = 480;
37 37
 
38 38
     private static $colourSet = [
39
-        'mediumpurple1',    'palegreen3',     'gold1',          'cadetblue1',
40
-        'darkmagenta',      'coral',          'dodgerblue3',    'eggplant',
41
-        'mediumblue',       'magenta',        'sandybrown',     'cyan',
42
-        'firebrick1',       'forestgreen',    'deeppink4',      'darkolivegreen',
39
+        'mediumpurple1', 'palegreen3', 'gold1', 'cadetblue1',
40
+        'darkmagenta', 'coral', 'dodgerblue3', 'eggplant',
41
+        'mediumblue', 'magenta', 'sandybrown', 'cyan',
42
+        'firebrick1', 'forestgreen', 'deeppink4', 'darkolivegreen',
43 43
         'goldenrod2'
44 44
     ];
45 45
 
@@ -188,21 +188,21 @@  discard block
 block discarded – undo
188 188
             $legendOverlay = $legend->getOverlay();
189 189
             switch ($legendPosition) {
190 190
                 case 'r':
191
-                    $this->graph->legend->SetPos(0.01, 0.5, 'right', 'center');    //    right
191
+                    $this->graph->legend->SetPos(0.01, 0.5, 'right', 'center'); //    right
192 192
                     $this->graph->legend->SetColumns(1);
193 193
                     break;
194 194
                 case 'l':
195
-                    $this->graph->legend->SetPos(0.01, 0.5, 'left', 'center');    //    left
195
+                    $this->graph->legend->SetPos(0.01, 0.5, 'left', 'center'); //    left
196 196
                     $this->graph->legend->SetColumns(1);
197 197
                     break;
198 198
                 case 't':
199
-                    $this->graph->legend->SetPos(0.5, 0.01, 'center', 'top');    //    top
199
+                    $this->graph->legend->SetPos(0.5, 0.01, 'center', 'top'); //    top
200 200
                     break;
201 201
                 case 'b':
202
-                    $this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom');    //    bottom
202
+                    $this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom'); //    bottom
203 203
                     break;
204 204
                 default:
205
-                    $this->graph->legend->SetPos(0.01, 0.01, 'right', 'top');    //    top-right
205
+                    $this->graph->legend->SetPos(0.01, 0.01, 'right', 'top'); //    top-right
206 206
                     $this->graph->legend->SetColumns(1);
207 207
                     break;
208 208
             }
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 
566 566
     private function renderAreaChart($groupCount, $dimensions = '2d')
567 567
     {
568
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
568
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_line.php');
569 569
 
570 570
         $this->renderCartesianPlotArea();
571 571
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 
578 578
     private function renderLineChart($groupCount, $dimensions = '2d')
579 579
     {
580
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
580
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_line.php');
581 581
 
582 582
         $this->renderCartesianPlotArea();
583 583
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 
590 590
     private function renderBarChart($groupCount, $dimensions = '2d')
591 591
     {
592
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
592
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_bar.php');
593 593
 
594 594
         $this->renderCartesianPlotArea();
595 595
 
@@ -601,9 +601,9 @@  discard block
 block discarded – undo
601 601
 
602 602
     private function renderScatterChart($groupCount)
603 603
     {
604
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
605
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
606
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
604
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_scatter.php');
605
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_regstat.php');
606
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_line.php');
607 607
 
608 608
         $this->renderCartesianPlotArea('linlin');
609 609
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 
616 616
     private function renderBubbleChart($groupCount)
617 617
     {
618
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
618
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_scatter.php');
619 619
 
620 620
         $this->renderCartesianPlotArea('linlin');
621 621
 
@@ -627,9 +627,9 @@  discard block
 block discarded – undo
627 627
 
628 628
     private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
629 629
     {
630
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie.php');
630
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_pie.php');
631 631
         if ($dimensions == '3d') {
632
-            require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie3d.php');
632
+            require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_pie3d.php');
633 633
         }
634 634
 
635 635
         $this->renderPiePlotArea($doughnut);
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
                 }
676 676
 
677 677
                 if ($multiplePlots) {
678
-                    $seriesPlot->SetSize(($jLimit-$j) / ($jLimit * 4));
678
+                    $seriesPlot->SetSize(($jLimit - $j) / ($jLimit * 4));
679 679
                 }
680 680
 
681 681
                 if ($doughnut) {
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 
705 705
     private function renderRadarChart($groupCount)
706 706
     {
707
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php');
707
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_radar.php');
708 708
 
709 709
         $this->renderRadarPlotArea();
710 710
 
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 
717 717
     private function renderStockChart($groupCount)
718 718
     {
719
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php');
719
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_stock.php');
720 720
 
721 721
         $this->renderCartesianPlotArea('intint');
722 722
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 
729 729
     private function renderContourChart($groupCount, $dimensions)
730 730
     {
731
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php');
731
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_contour.php');
732 732
 
733 733
         $this->renderCartesianPlotArea('intint');
734 734
 
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 
741 741
     private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
742 742
     {
743
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
744
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
745
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
746
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
747
-        require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
743
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_line.php');
744
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_bar.php');
745
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_scatter.php');
746
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_regstat.php');
747
+        require_once(\PHPExcel\Settings::getChartRendererPath() . 'jpgraph_line.php');
748 748
 
749 749
         $this->renderCartesianPlotArea();
750 750
 
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
                 $this->renderStockChart($groupCount, $dimensions);
865 865
                 break;
866 866
             default:
867
-                echo $chartType.' is not yet implemented<br />';
867
+                echo $chartType . ' is not yet implemented<br />';
868 868
                 return false;
869 869
         }
870 870
         $this->renderLegend();
Please login to merge, or discard this patch.