Completed
Pull Request — develop (#189)
by Manuel
35:39
created
src/PhpSpreadsheet/Calculation/Engineering.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1853,7 +1853,7 @@  discard block
 block discarded – undo
1853 1853
      *
1854 1854
      * @param string $complexNumber the complex number for which you want the real coefficient
1855 1855
      *
1856
-     * @return float
1856
+     * @return string
1857 1857
      */
1858 1858
     public static function IMREAL($complexNumber)
1859 1859
     {
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
      * Excel Function:
2292 2292
      *        IMSUM(complexNumber[,complexNumber[,...]])
2293 2293
      *
2294
-     * @param string $complexNumbers Series of complex numbers to add
2294
+     * @param string[] $complexNumbers Series of complex numbers to add
2295 2295
      *
2296 2296
      * @return string
2297 2297
      */
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
      * Excel Function:
2332 2332
      *        IMPRODUCT(complexNumber[,complexNumber[,...]])
2333 2333
      *
2334
-     * @param string $complexNumbers Series of complex numbers to multiply
2334
+     * @param string[] $complexNumbers Series of complex numbers to multiply
2335 2335
      *
2336 2336
      * @return string
2337 2337
      */
@@ -2375,7 +2375,7 @@  discard block
 block discarded – undo
2375 2375
      *        DELTA(a[,b])
2376 2376
      *
2377 2377
      * @param float $a the first number
2378
-     * @param float $b The second number. If omitted, b is assumed to be zero.
2378
+     * @param integer $b The second number. If omitted, b is assumed to be zero.
2379 2379
      *
2380 2380
      * @return int
2381 2381
      */
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
      * functions you calculate the count of values that exceed a threshold.
2399 2399
      *
2400 2400
      * @param float $number the value to test against step
2401
-     * @param float $step The threshold value.
2401
+     * @param integer $step The threshold value.
2402 2402
      *                                    If you omit a value for step, GESTEP uses zero.
2403 2403
      *
2404 2404
      * @return int
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig.php 1 patch
Doc Comments   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -52,6 +52,10 @@  discard block
 block discarded – undo
52 52
         return [(int) $value];
53 53
     }
54 54
 
55
+    /**
56
+     * @param integer $num
57
+     * @param integer $n
58
+     */
55 59
     private static function romanCut($num, $n)
56 60
     {
57 61
         return ($num - ($num % $n)) / $n;
@@ -504,7 +508,7 @@  discard block
 block discarded – undo
504 508
      * @category Mathematical and Trigonometric Functions
505 509
      *
506 510
      * @param float $number The positive real number for which you want the logarithm
507
-     * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10.
511
+     * @param integer $base The base of the logarithm. If base is omitted, it is assumed to be 10.
508 512
      *
509 513
      * @return float
510 514
      */
@@ -822,8 +826,8 @@  discard block
 block discarded – undo
822 826
      *
823 827
      * Computes x raised to the power y.
824 828
      *
825
-     * @param float $x
826
-     * @param float $y
829
+     * @param integer $x
830
+     * @param integer $y
827 831
      *
828 832
      * @return float
829 833
      */
@@ -897,7 +901,7 @@  discard block
 block discarded – undo
897 901
      *
898 902
      * @param mixed $args Data values
899 903
      *
900
-     * @return float
904
+     * @return integer
901 905
      */
902 906
     public static function QUOTIENT(...$args)
903 907
     {
@@ -1035,9 +1039,6 @@  discard block
 block discarded – undo
1035 1039
      *
1036 1040
      * Returns the sum of a power series
1037 1041
      *
1038
-     * @param float $x Input value to the power series
1039
-     * @param float $n Initial power to which you want to raise $x
1040
-     * @param float $m Step by which to increase $n for each term in the series
1041 1042
      * @param array of mixed Data Series
1042 1043
      *
1043 1044
      * @return float
@@ -1215,7 +1216,7 @@  discard block
 block discarded – undo
1215 1216
      * @param mixed $aArgs
1216 1217
      * @param mixed $sumArgs
1217 1218
      *
1218
-     * @return float
1219
+     * @return integer
1219 1220
      */
1220 1221
     public static function SUMIF($aArgs, $condition, $sumArgs = [])
1221 1222
     {
@@ -1255,9 +1256,8 @@  discard block
 block discarded – undo
1255 1256
      *    @category Mathematical and Trigonometric Functions
1256 1257
      *
1257 1258
      * @param mixed $args Data values
1258
-     * @param string $condition the criteria that defines which cells will be summed
1259 1259
      *
1260
-     * @return float
1260
+     * @return integer
1261 1261
      */
1262 1262
     public static function SUMIFS(...$args)
1263 1263
     {
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
      *
1447 1447
      * Truncates value to the number of fractional digits by number_digits.
1448 1448
      *
1449
-     * @param float $value
1449
+     * @param integer $value
1450 1450
      * @param int $digits
1451 1451
      *
1452 1452
      * @return float Truncated value
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Statistical.php 1 patch
Doc Comments   +9 added lines, -14 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      * @param mixed $p
134 134
      * @param mixed $q
135 135
      *
136
-     * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
136
+     * @return double if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
137 137
      *
138 138
      * @author Jaco van Kooten
139 139
      */
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
      * @author Jaco van Kooten
160 160
      *
161 161
      * @param mixed $x
162
-     * @param mixed $p
163
-     * @param mixed $q
162
+     * @param double $p
163
+     * @param double $q
164 164
      */
165 165
     private static function betaFraction($x, $p, $q)
166 166
     {
@@ -909,8 +909,8 @@  discard block
 block discarded – undo
909 909
      * @param float $value Value at which you want to evaluate the distribution
910 910
      * @param float $alpha Parameter to the distribution
911 911
      * @param float $beta Parameter to the distribution
912
-     * @param mixed $rMin
913
-     * @param mixed $rMax
912
+     * @param integer $rMin
913
+     * @param integer $rMax
914 914
      *
915 915
      * @return float
916 916
      */
@@ -948,8 +948,8 @@  discard block
 block discarded – undo
948 948
      * @param float $probability Probability at which you want to evaluate the distribution
949 949
      * @param float $alpha Parameter to the distribution
950 950
      * @param float $beta Parameter to the distribution
951
-     * @param float $rMin Minimum value
952
-     * @param float $rMax Maximum value
951
+     * @param integer $rMin Minimum value
952
+     * @param integer $rMax Maximum value
953 953
      *
954 954
      * @return float
955 955
      */
@@ -2015,7 +2015,6 @@  discard block
 block discarded – undo
2015 2015
      * @category Statistical Functions
2016 2016
      *
2017 2017
      * @param mixed $args Data values
2018
-     * @param int $entry Position (ordered from the largest) in the array or range of data to return
2019 2018
      *
2020 2019
      * @return float
2021 2020
      */
@@ -2745,7 +2744,6 @@  discard block
 block discarded – undo
2745 2744
      * @category Statistical Functions
2746 2745
      *
2747 2746
      * @param mixed $args Data values
2748
-     * @param float $entry Percentile value in the range 0..1, inclusive.
2749 2747
      *
2750 2748
      * @return float
2751 2749
      */
@@ -2796,7 +2794,7 @@  discard block
 block discarded – undo
2796 2794
      * @param number the number of significant digits for the returned percentage value
2797 2795
      * @param mixed $valueSet
2798 2796
      * @param mixed $value
2799
-     * @param mixed $significance
2797
+     * @param integer $significance
2800 2798
      *
2801 2799
      * @return float
2802 2800
      */
@@ -2917,7 +2915,6 @@  discard block
 block discarded – undo
2917 2915
      * @category Statistical Functions
2918 2916
      *
2919 2917
      * @param mixed $args Data values
2920
-     * @param int $entry Quartile value in the range 1..3, inclusive.
2921 2918
      *
2922 2919
      * @return float
2923 2920
      */
@@ -2950,7 +2947,7 @@  discard block
 block discarded – undo
2950 2947
      * @param mixed Order to sort the values in the value set
2951 2948
      * @param mixed $value
2952 2949
      * @param mixed $valueSet
2953
-     * @param mixed $order
2950
+     * @param integer $order
2954 2951
      *
2955 2952
      * @return float
2956 2953
      */
@@ -3092,7 +3089,6 @@  discard block
 block discarded – undo
3092 3089
      * @category Statistical Functions
3093 3090
      *
3094 3091
      * @param mixed $args Data values
3095
-     * @param int $entry Position (ordered from the smallest) in the array or range of data to return
3096 3092
      *
3097 3093
      * @return float
3098 3094
      */
@@ -3556,7 +3552,6 @@  discard block
 block discarded – undo
3556 3552
      * @category Statistical Functions
3557 3553
      *
3558 3554
      * @param mixed $args Data values
3559
-     * @param float $discard Percentage to discard
3560 3555
      *
3561 3556
      * @return float
3562 3557
      */
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5118,7 +5118,7 @@  discard block
 block discarded – undo
5118 5118
      * is in one piece.
5119 5119
      * Moves to next current position in data stream to start of next record different from a CONtINUE record.
5120 5120
      *
5121
-     * @return array
5121
+     * @return integer|null
5122 5122
      */
5123 5123
     private function getSplicedRecordData()
5124 5124
     {
@@ -5368,7 +5368,7 @@  discard block
 block discarded – undo
5368 5368
      *
5369 5369
      * @throws Exception
5370 5370
      *
5371
-     * @return array
5371
+     * @return string
5372 5372
      */
5373 5373
     private function getNextToken($formulaData, $baseCell = 'A1')
5374 5374
     {
@@ -6945,7 +6945,7 @@  discard block
 block discarded – undo
6945 6945
      *
6946 6946
      * @param string $subData
6947 6947
      *
6948
-     * @return array
6948
+     * @return string
6949 6949
      */
6950 6950
     private function readBIFF8CellRangeAddressList($subData)
6951 6951
     {
@@ -7060,7 +7060,7 @@  discard block
 block discarded – undo
7060 7060
      *
7061 7061
      * @param string $arrayData
7062 7062
      *
7063
-     * @return array
7063
+     * @return string
7064 7064
      */
7065 7065
     private static function readBIFF8ConstantArray($arrayData)
7066 7066
     {
@@ -7099,7 +7099,7 @@  discard block
 block discarded – undo
7099 7099
      *
7100 7100
      * @param string $valueData
7101 7101
      *
7102
-     * @return array
7102
+     * @return string
7103 7103
      */
7104 7104
     private static function readBIFF8Constant($valueData)
7105 7105
     {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls/MD5.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -187,6 +187,11 @@
 block discarded – undo
187 187
         return $Y ^ ($X | (~$Z)); // Y XOR (X OR NOT Z)
188 188
     }
189 189
 
190
+    /**
191
+     * @param string[] $func
192
+     * @param integer $s
193
+     * @param integer $t
194
+     */
190 195
     private static function step($func, &$A, $B, $C, $D, $M, $s, $t)
191 196
     {
192 197
         $A = ($A + call_user_func($func, $B, $C, $D) + $M + $t) & 0xffffffff;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
     /**
148 148
      * Get parent. Only used for style supervisor.
149 149
      *
150
-     * @return Spreadsheet
150
+     * @return Style
151 151
      */
152 152
     public function getParent()
153 153
     {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Xls/Parser.php 1 patch
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
      *
506 506
      * @param mixed $token the token to convert
507 507
      *
508
-     * @return mixed the converted token on success
508
+     * @return string the converted token on success
509 509
      */
510 510
     private function convert($token)
511 511
     {
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
      *
577 577
      * @param string $string a string for conversion to its ptg value
578 578
      *
579
-     * @return mixed the converted token on success
579
+     * @return string the converted token on success
580 580
      */
581 581
     private function convertString($string)
582 582
     {
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
      *
655 655
      * @param string $token an Excel range in the Sheet1!A1:A2 format
656 656
      *
657
-     * @return mixed the packed ptgArea3d token on success
657
+     * @return string the packed ptgArea3d token on success
658 658
      */
659 659
     private function convertRange3d($token)
660 660
     {
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
      *
707 707
      * @param string $cell An Excel cell reference
708 708
      *
709
-     * @return mixed the packed ptgRef3d token on success
709
+     * @return string the packed ptgRef3d token on success
710 710
      */
711 711
     private function convertRef3d($cell)
712 712
     {
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
      *
806 806
      * @param string $ext_ref The name of the external reference
807 807
      *
808
-     * @return mixed The reference index in packed() format on success
808
+     * @return string The reference index in packed() format on success
809 809
      */
810 810
     private function getRefIndex($ext_ref)
811 811
     {
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
      *
897 897
      * @param string $cell The Excel cell reference to be packed
898 898
      *
899
-     * @return array Array containing the row and column in packed() format
899
+     * @return string[] Array containing the row and column in packed() format
900 900
      */
901 901
     private function cellToPackedRowcol($cell)
902 902
     {
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
      *
926 926
      * @param string $range The Excel range to be packed
927 927
      *
928
-     * @return array Array containing (row1,col1,row2,col2) in packed() format
928
+     * @return string[] Array containing (row1,col1,row2,col2) in packed() format
929 929
      */
930 930
     private function rangeToPackedRange($range)
931 931
     {
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
     /**
1042 1042
      * Checks if it's a valid token.
1043 1043
      *
1044
-     * @param mixed $token the token to check
1044
+     * @param string $token the token to check
1045 1045
      *
1046 1046
      * @return mixed The checked token or false on failure
1047 1047
      */
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
      * @param string $formula the formula to parse, without the initial equal
1128 1128
      *                        sign (=)
1129 1129
      *
1130
-     * @return mixed true on success
1130
+     * @return boolean true on success
1131 1131
      */
1132 1132
     public function parse($formula)
1133 1133
     {
Please login to merge, or discard this patch.
docs/Examples/Reading WorkBook Data/exampleWorkBookReader01.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,53 +37,53 @@
 block discarded – undo
37 37
 
38 38
 /*  Read the document's creator property  **/
39 39
 $creator = $spreadsheet->getProperties()->getCreator();
40
-echo '<b>Document Creator: </b>',$creator,'<br />';
40
+echo '<b>Document Creator: </b>', $creator, '<br />';
41 41
 
42 42
 /*  Read the Date when the workbook was created (as a PHP timestamp value)  **/
43 43
 $creationDatestamp = $spreadsheet->getProperties()->getCreated();
44 44
 /*  Format the date and time using the standard PHP date() function  **/
45 45
 $creationDate = date('l, d<\s\up>S</\s\up> F Y', $creationDatestamp);
46 46
 $creationTime = date('g:i A', $creationDatestamp);
47
-echo '<b>Created On: </b>',$creationDate,' at ',$creationTime,'<br />';
47
+echo '<b>Created On: </b>', $creationDate, ' at ', $creationTime, '<br />';
48 48
 
49 49
 /*  Read the name of the last person to modify this workbook  **/
50 50
 $modifiedBy = $spreadsheet->getProperties()->getLastModifiedBy();
51
-echo '<b>Last Modified By: </b>',$modifiedBy,'<br />';
51
+echo '<b>Last Modified By: </b>', $modifiedBy, '<br />';
52 52
 
53 53
 /*  Read the Date when the workbook was last modified (as a PHP timestamp value)  **/
54 54
 $modifiedDatestamp = $spreadsheet->getProperties()->getModified();
55 55
 /*  Format the date and time using the standard PHP date() function  **/
56 56
 $modifiedDate = date('l, d<\s\up>S</\s\up> F Y', $modifiedDatestamp);
57 57
 $modifiedTime = date('g:i A', $modifiedDatestamp);
58
-echo '<b>Last Modified On: </b>',$modifiedDate,' at ',$modifiedTime,'<br />';
58
+echo '<b>Last Modified On: </b>', $modifiedDate, ' at ', $modifiedTime, '<br />';
59 59
 
60 60
 /*  Read the workbook title property  **/
61 61
 $workbookTitle = $spreadsheet->getProperties()->getTitle();
62
-echo '<b>Title: </b>',$workbookTitle,'<br />';
62
+echo '<b>Title: </b>', $workbookTitle, '<br />';
63 63
 
64 64
 /*  Read the workbook description property  **/
65 65
 $description = $spreadsheet->getProperties()->getDescription();
66
-echo '<b>Description: </b>',$description,'<br />';
66
+echo '<b>Description: </b>', $description, '<br />';
67 67
 
68 68
 /*  Read the workbook subject property  **/
69 69
 $subject = $spreadsheet->getProperties()->getSubject();
70
-echo '<b>Subject: </b>',$subject,'<br />';
70
+echo '<b>Subject: </b>', $subject, '<br />';
71 71
 
72 72
 /*  Read the workbook keywords property  **/
73 73
 $keywords = $spreadsheet->getProperties()->getKeywords();
74
-echo '<b>Keywords: </b>',$keywords,'<br />';
74
+echo '<b>Keywords: </b>', $keywords, '<br />';
75 75
 
76 76
 /*  Read the workbook category property  **/
77 77
 $category = $spreadsheet->getProperties()->getCategory();
78
-echo '<b>Category: </b>',$category,'<br />';
78
+echo '<b>Category: </b>', $category, '<br />';
79 79
 
80 80
 /*  Read the workbook company property  **/
81 81
 $company = $spreadsheet->getProperties()->getCompany();
82
-echo '<b>Company: </b>',$company,'<br />';
82
+echo '<b>Company: </b>', $company, '<br />';
83 83
 
84 84
 /*  Read the workbook manager property  **/
85 85
 $manager = $spreadsheet->getProperties()->getManager();
86
-echo '<b>Manager: </b>',$manager,'<br />';
86
+echo '<b>Manager: </b>', $manager, '<br />';
87 87
 
88 88
 ?>
89 89
 <body>
Please login to merge, or discard this patch.
docs/Examples/Calculations/Database/DAVERAGE.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@
 block discarded – undo
31 31
 
32 32
 // Add some data
33 33
 $database = [['Tree',  'Height', 'Age', 'Yield', 'Profit'],
34
-                   ['Apple',  18,       20,    14,      105.00],
35
-                   ['Pear',   12,       12,    10,       96.00],
36
-                   ['Cherry', 13,       14,     9,      105.00],
37
-                   ['Apple',  14,       15,    10,       75.00],
38
-                   ['Pear',    9,        8,     8,       76.80],
39
-                   ['Apple',   8,        9,     6,       45.00],
40
-                 ];
34
+                    ['Apple',  18,       20,    14,      105.00],
35
+                    ['Pear',   12,       12,    10,       96.00],
36
+                    ['Cherry', 13,       14,     9,      105.00],
37
+                    ['Apple',  14,       15,    10,       75.00],
38
+                    ['Pear',    9,        8,     8,       76.80],
39
+                    ['Apple',   8,        9,     6,       45.00],
40
+                    ];
41 41
 $criteria = [['Tree',      'Height', 'Age', 'Yield', 'Profit', 'Height'],
42
-                   ['="=Apple"', '>10',    null,  null,    null,     '<16'],
43
-                   ['="=Pear"',  null,     null,  null,    null,     null],
44
-                 ];
42
+                    ['="=Apple"', '>10',    null,  null,    null,     '<16'],
43
+                    ['="=Pear"',  null,     null,  null,    null,     null],
44
+                    ];
45 45
 
46 46
 $worksheet->fromArray($criteria, null, 'A1');
47 47
 $worksheet->fromArray($database, null, 'A4');
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,17 +30,17 @@
 block discarded – undo
30 30
 $worksheet = $spreadsheet->getActiveSheet();
31 31
 
32 32
 // Add some data
33
-$database = [['Tree',  'Height', 'Age', 'Yield', 'Profit'],
34
-                   ['Apple',  18,       20,    14,      105.00],
35
-                   ['Pear',   12,       12,    10,       96.00],
36
-                   ['Cherry', 13,       14,     9,      105.00],
37
-                   ['Apple',  14,       15,    10,       75.00],
38
-                   ['Pear',    9,        8,     8,       76.80],
39
-                   ['Apple',   8,        9,     6,       45.00],
33
+$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
34
+                   ['Apple', 18, 20, 14, 105.00],
35
+                   ['Pear', 12, 12, 10, 96.00],
36
+                   ['Cherry', 13, 14, 9, 105.00],
37
+                   ['Apple', 14, 15, 10, 75.00],
38
+                   ['Pear', 9, 8, 8, 76.80],
39
+                   ['Apple', 8, 9, 6, 45.00],
40 40
                  ];
41
-$criteria = [['Tree',      'Height', 'Age', 'Yield', 'Profit', 'Height'],
42
-                   ['="=Apple"', '>10',    null,  null,    null,     '<16'],
43
-                   ['="=Pear"',  null,     null,  null,    null,     null],
41
+$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
42
+                   ['="=Apple"', '>10', null, null, null, '<16'],
43
+                   ['="=Pear"', null, null, null, null, null],
44 44
                  ];
45 45
 
46 46
 $worksheet->fromArray($criteria, null, 'A1');
Please login to merge, or discard this patch.