@@ -53,6 +53,10 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @param integer $num |
|
58 | + * @param integer $n |
|
59 | + */ |
|
56 | 60 | private static function romanCut($num, $n) |
57 | 61 | { |
58 | 62 | return ($num - ($num % $n)) / $n; |
@@ -344,7 +348,6 @@ discard block |
||
344 | 348 | * |
345 | 349 | * @category Mathematical and Trigonometric Functions |
346 | 350 | * |
347 | - * @param mixed $arg,... Data values |
|
348 | 351 | * |
349 | 352 | * @return int Greatest Common Divisor |
350 | 353 | */ |
@@ -454,7 +457,6 @@ discard block |
||
454 | 457 | * |
455 | 458 | * @category Mathematical and Trigonometric Functions |
456 | 459 | * |
457 | - * @param mixed $arg,... Data values |
|
458 | 460 | * |
459 | 461 | * @return int Lowest Common Multiplier |
460 | 462 | */ |
@@ -506,7 +508,7 @@ discard block |
||
506 | 508 | * @category Mathematical and Trigonometric Functions |
507 | 509 | * |
508 | 510 | * @param float $number The positive real number for which you want the logarithm |
509 | - * @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 |
|
510 | 512 | * |
511 | 513 | * @return float |
512 | 514 | */ |
@@ -824,8 +826,8 @@ discard block |
||
824 | 826 | * |
825 | 827 | * Computes x raised to the power y. |
826 | 828 | * |
827 | - * @param float $x |
|
828 | - * @param float $y |
|
829 | + * @param integer $x |
|
830 | + * @param integer $y |
|
829 | 831 | * |
830 | 832 | * @return float |
831 | 833 | */ |
@@ -857,7 +859,6 @@ discard block |
||
857 | 859 | * |
858 | 860 | * @category Mathematical and Trigonometric Functions |
859 | 861 | * |
860 | - * @param mixed $arg,... Data values |
|
861 | 862 | * |
862 | 863 | * @return float |
863 | 864 | */ |
@@ -897,9 +898,8 @@ discard block |
||
897 | 898 | * |
898 | 899 | * @category Mathematical and Trigonometric Functions |
899 | 900 | * |
900 | - * @param mixed $arg,... Data values |
|
901 | 901 | * |
902 | - * @return float |
|
902 | + * @return integer |
|
903 | 903 | */ |
904 | 904 | public static function QUOTIENT() |
905 | 905 | { |
@@ -1037,9 +1037,6 @@ discard block |
||
1037 | 1037 | * |
1038 | 1038 | * Returns the sum of a power series |
1039 | 1039 | * |
1040 | - * @param float $x Input value to the power series |
|
1041 | - * @param float $n Initial power to which you want to raise $x |
|
1042 | - * @param float $m Step by which to increase $n for each term in the series |
|
1043 | 1040 | * @param array of mixed Data Series |
1044 | 1041 | * |
1045 | 1042 | * @return float |
@@ -1183,7 +1180,6 @@ discard block |
||
1183 | 1180 | * |
1184 | 1181 | * @category Mathematical and Trigonometric Functions |
1185 | 1182 | * |
1186 | - * @param mixed $arg,... Data values |
|
1187 | 1183 | * |
1188 | 1184 | * @return float |
1189 | 1185 | */ |
@@ -1212,10 +1208,9 @@ discard block |
||
1212 | 1208 | * |
1213 | 1209 | * @category Mathematical and Trigonometric Functions |
1214 | 1210 | * |
1215 | - * @param mixed $arg,... Data values |
|
1216 | 1211 | * @param string $condition The criteria that defines which cells will be summed |
1217 | 1212 | * |
1218 | - * @return float |
|
1213 | + * @return integer |
|
1219 | 1214 | */ |
1220 | 1215 | public static function SUMIF($aArgs, $condition, $sumArgs = []) |
1221 | 1216 | { |
@@ -1254,10 +1249,7 @@ discard block |
||
1254 | 1249 | * |
1255 | 1250 | * @category Mathematical and Trigonometric Functions |
1256 | 1251 | * |
1257 | - * @param mixed $arg,... Data values |
|
1258 | - * @param string $condition The criteria that defines which cells will be summed |
|
1259 | - * |
|
1260 | - * @return float |
|
1252 | + * @return integer |
|
1261 | 1253 | */ |
1262 | 1254 | public static function SUMIFS() |
1263 | 1255 | { |
@@ -1302,7 +1294,6 @@ discard block |
||
1302 | 1294 | * |
1303 | 1295 | * @category Mathematical and Trigonometric Functions |
1304 | 1296 | * |
1305 | - * @param mixed $arg,... Data values |
|
1306 | 1297 | * |
1307 | 1298 | * @return float |
1308 | 1299 | */ |
@@ -1347,7 +1338,6 @@ discard block |
||
1347 | 1338 | * |
1348 | 1339 | * @category Mathematical and Trigonometric Functions |
1349 | 1340 | * |
1350 | - * @param mixed $arg,... Data values |
|
1351 | 1341 | * |
1352 | 1342 | * @return float |
1353 | 1343 | */ |
@@ -1446,7 +1436,7 @@ discard block |
||
1446 | 1436 | * |
1447 | 1437 | * Truncates value to the number of fractional digits by number_digits. |
1448 | 1438 | * |
1449 | - * @param float $value |
|
1439 | + * @param integer $value |
|
1450 | 1440 | * @param int $digits |
1451 | 1441 | * |
1452 | 1442 | * @return float Truncated value |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | $t = self::romanCut($aValue, 10); |
976 | 976 | $aValue %= 10; |
977 | 977 | |
978 | - return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue]; |
|
978 | + return $roman . $mill[$m] . $cent[$c] . $tens[$t] . $ones[$aValue]; |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | /** |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
1235 | 1235 | } |
1236 | 1236 | |
1237 | - $testCondition = '='.$arg.$condition; |
|
1237 | + $testCondition = '=' . $arg . $condition; |
|
1238 | 1238 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1239 | 1239 | // Is it a value within our criteria |
1240 | 1240 | $returnValue += $sumArgs[$key]; |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | if (!is_numeric($arg)) { |
1283 | 1283 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
1284 | 1284 | } |
1285 | - $testCondition = '='.$arg.$condition; |
|
1285 | + $testCondition = '=' . $arg . $condition; |
|
1286 | 1286 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1287 | 1287 | // Is it a value within our criteria |
1288 | 1288 | $returnValue += $sumArgs[$key]; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @param p require p>0 |
131 | 131 | * @param q require q>0 |
132 | 132 | * |
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 | * |
135 | 135 | * @author Jaco van Kooten |
136 | 136 | */ |
@@ -154,6 +154,8 @@ discard block |
||
154 | 154 | * Based on an idea from Numerical Recipes (W.H. Press et al, 1992). |
155 | 155 | * |
156 | 156 | * @author Jaco van Kooten |
157 | + * @param double $p |
|
158 | + * @param double $q |
|
157 | 159 | */ |
158 | 160 | private static function betaFraction($x, $p, $q) |
159 | 161 | { |
@@ -711,7 +713,6 @@ discard block |
||
711 | 713 | * |
712 | 714 | * @category Statistical Functions |
713 | 715 | * |
714 | - * @param mixed $arg,... Data values |
|
715 | 716 | * |
716 | 717 | * @return float |
717 | 718 | */ |
@@ -762,7 +763,6 @@ discard block |
||
762 | 763 | * |
763 | 764 | * @category Statistical Functions |
764 | 765 | * |
765 | - * @param mixed $arg,... Data values |
|
766 | 766 | * |
767 | 767 | * @return float |
768 | 768 | */ |
@@ -805,7 +805,6 @@ discard block |
||
805 | 805 | * |
806 | 806 | * @category Statistical Functions |
807 | 807 | * |
808 | - * @param mixed $arg,... Data values |
|
809 | 808 | * |
810 | 809 | * @return float |
811 | 810 | */ |
@@ -852,7 +851,6 @@ discard block |
||
852 | 851 | * |
853 | 852 | * @category Mathematical and Trigonometric Functions |
854 | 853 | * |
855 | - * @param mixed $arg,... Data values |
|
856 | 854 | * @param string $condition The criteria that defines which cells will be checked |
857 | 855 | * @param mixed[] $averageArgs Data values |
858 | 856 | * |
@@ -935,8 +933,8 @@ discard block |
||
935 | 933 | * @param float $probability Probability at which you want to evaluate the distribution |
936 | 934 | * @param float $alpha Parameter to the distribution |
937 | 935 | * @param float $beta Parameter to the distribution |
938 | - * @param float $rMin Minimum value |
|
939 | - * @param float $rMax Maximum value |
|
936 | + * @param integer $rMin Minimum value |
|
937 | + * @param integer $rMax Maximum value |
|
940 | 938 | * |
941 | 939 | * @return float |
942 | 940 | */ |
@@ -1194,7 +1192,6 @@ discard block |
||
1194 | 1192 | * |
1195 | 1193 | * @category Statistical Functions |
1196 | 1194 | * |
1197 | - * @param mixed $arg,... Data values |
|
1198 | 1195 | * |
1199 | 1196 | * @return int |
1200 | 1197 | */ |
@@ -1228,7 +1225,6 @@ discard block |
||
1228 | 1225 | * |
1229 | 1226 | * @category Statistical Functions |
1230 | 1227 | * |
1231 | - * @param mixed $arg,... Data values |
|
1232 | 1228 | * |
1233 | 1229 | * @return int |
1234 | 1230 | */ |
@@ -1258,7 +1254,6 @@ discard block |
||
1258 | 1254 | * |
1259 | 1255 | * @category Statistical Functions |
1260 | 1256 | * |
1261 | - * @param mixed $arg,... Data values |
|
1262 | 1257 | * |
1263 | 1258 | * @return int |
1264 | 1259 | */ |
@@ -1288,7 +1283,6 @@ discard block |
||
1288 | 1283 | * |
1289 | 1284 | * @category Statistical Functions |
1290 | 1285 | * |
1291 | - * @param mixed $arg,... Data values |
|
1292 | 1286 | * @param string $condition The criteria that defines which cells will be counted |
1293 | 1287 | * |
1294 | 1288 | * @return int |
@@ -1476,7 +1470,6 @@ discard block |
||
1476 | 1470 | * |
1477 | 1471 | * @category Statistical Functions |
1478 | 1472 | * |
1479 | - * @param mixed $arg,... Data values |
|
1480 | 1473 | * |
1481 | 1474 | * @return float |
1482 | 1475 | */ |
@@ -1767,7 +1760,6 @@ discard block |
||
1767 | 1760 | * |
1768 | 1761 | * @category Statistical Functions |
1769 | 1762 | * |
1770 | - * @param mixed $arg,... Data values |
|
1771 | 1763 | * |
1772 | 1764 | * @return float |
1773 | 1765 | */ |
@@ -1829,7 +1821,6 @@ discard block |
||
1829 | 1821 | * |
1830 | 1822 | * @category Statistical Functions |
1831 | 1823 | * |
1832 | - * @param mixed $arg,... Data values |
|
1833 | 1824 | * |
1834 | 1825 | * @return float |
1835 | 1826 | */ |
@@ -1988,8 +1979,6 @@ discard block |
||
1988 | 1979 | * |
1989 | 1980 | * @category Statistical Functions |
1990 | 1981 | * |
1991 | - * @param mixed $arg,... Data values |
|
1992 | - * @param int $entry Position (ordered from the largest) in the array or range of data to return |
|
1993 | 1982 | * |
1994 | 1983 | * @return float |
1995 | 1984 | */ |
@@ -2217,7 +2206,6 @@ discard block |
||
2217 | 2206 | * |
2218 | 2207 | * @category Statistical Functions |
2219 | 2208 | * |
2220 | - * @param mixed $arg,... Data values |
|
2221 | 2209 | * |
2222 | 2210 | * @return float |
2223 | 2211 | */ |
@@ -2253,7 +2241,6 @@ discard block |
||
2253 | 2241 | * |
2254 | 2242 | * @category Statistical Functions |
2255 | 2243 | * |
2256 | - * @param mixed $arg,... Data values |
|
2257 | 2244 | * |
2258 | 2245 | * @return float |
2259 | 2246 | */ |
@@ -2294,7 +2281,6 @@ discard block |
||
2294 | 2281 | * |
2295 | 2282 | * @category Mathematical and Trigonometric Functions |
2296 | 2283 | * |
2297 | - * @param mixed $arg,... Data values |
|
2298 | 2284 | * @param string $condition The criteria that defines which cells will be checked |
2299 | 2285 | * |
2300 | 2286 | * @return float |
@@ -2335,7 +2321,6 @@ discard block |
||
2335 | 2321 | * |
2336 | 2322 | * @category Statistical Functions |
2337 | 2323 | * |
2338 | - * @param mixed $arg,... Data values |
|
2339 | 2324 | * |
2340 | 2325 | * @return float |
2341 | 2326 | */ |
@@ -2379,7 +2364,6 @@ discard block |
||
2379 | 2364 | * |
2380 | 2365 | * @category Statistical Functions |
2381 | 2366 | * |
2382 | - * @param mixed $arg,... Data values |
|
2383 | 2367 | * |
2384 | 2368 | * @return float |
2385 | 2369 | */ |
@@ -2415,7 +2399,6 @@ discard block |
||
2415 | 2399 | * |
2416 | 2400 | * @category Statistical Functions |
2417 | 2401 | * |
2418 | - * @param mixed $arg,... Data values |
|
2419 | 2402 | * |
2420 | 2403 | * @return float |
2421 | 2404 | */ |
@@ -2456,7 +2439,6 @@ discard block |
||
2456 | 2439 | * |
2457 | 2440 | * @category Mathematical and Trigonometric Functions |
2458 | 2441 | * |
2459 | - * @param mixed $arg,... Data values |
|
2460 | 2442 | * @param string $condition The criteria that defines which cells will be checked |
2461 | 2443 | * |
2462 | 2444 | * @return float |
@@ -2533,7 +2515,6 @@ discard block |
||
2533 | 2515 | * |
2534 | 2516 | * @category Statistical Functions |
2535 | 2517 | * |
2536 | - * @param mixed $arg,... Data values |
|
2537 | 2518 | * |
2538 | 2519 | * @return float |
2539 | 2520 | */ |
@@ -2707,8 +2688,6 @@ discard block |
||
2707 | 2688 | * |
2708 | 2689 | * @category Statistical Functions |
2709 | 2690 | * |
2710 | - * @param mixed $arg,... Data values |
|
2711 | - * @param float $entry Percentile value in the range 0..1, inclusive |
|
2712 | 2691 | * |
2713 | 2692 | * @return float |
2714 | 2693 | */ |
@@ -2877,8 +2856,6 @@ discard block |
||
2877 | 2856 | * |
2878 | 2857 | * @category Statistical Functions |
2879 | 2858 | * |
2880 | - * @param mixed $arg,... Data values |
|
2881 | - * @param int $entry Quartile value in the range 1..3, inclusive |
|
2882 | 2859 | * |
2883 | 2860 | * @return float |
2884 | 2861 | */ |
@@ -3045,8 +3022,6 @@ discard block |
||
3045 | 3022 | * |
3046 | 3023 | * @category Statistical Functions |
3047 | 3024 | * |
3048 | - * @param mixed $arg,... Data values |
|
3049 | - * @param int $entry Position (ordered from the smallest) in the array or range of data to return |
|
3050 | 3025 | * |
3051 | 3026 | * @return float |
3052 | 3027 | */ |
@@ -3117,7 +3092,6 @@ discard block |
||
3117 | 3092 | * |
3118 | 3093 | * @category Statistical Functions |
3119 | 3094 | * |
3120 | - * @param mixed $arg,... Data values |
|
3121 | 3095 | * |
3122 | 3096 | * @return float |
3123 | 3097 | */ |
@@ -3166,7 +3140,6 @@ discard block |
||
3166 | 3140 | * |
3167 | 3141 | * @category Statistical Functions |
3168 | 3142 | * |
3169 | - * @param mixed $arg,... Data values |
|
3170 | 3143 | * |
3171 | 3144 | * @return float |
3172 | 3145 | */ |
@@ -3218,7 +3191,6 @@ discard block |
||
3218 | 3191 | * |
3219 | 3192 | * @category Statistical Functions |
3220 | 3193 | * |
3221 | - * @param mixed $arg,... Data values |
|
3222 | 3194 | * |
3223 | 3195 | * @return float |
3224 | 3196 | */ |
@@ -3265,7 +3237,6 @@ discard block |
||
3265 | 3237 | * |
3266 | 3238 | * @category Statistical Functions |
3267 | 3239 | * |
3268 | - * @param mixed $arg,... Data values |
|
3269 | 3240 | * |
3270 | 3241 | * @return float |
3271 | 3242 | */ |
@@ -3503,8 +3474,6 @@ discard block |
||
3503 | 3474 | * |
3504 | 3475 | * @category Statistical Functions |
3505 | 3476 | * |
3506 | - * @param mixed $arg,... Data values |
|
3507 | - * @param float $discard Percentage to discard |
|
3508 | 3477 | * |
3509 | 3478 | * @return float |
3510 | 3479 | */ |
@@ -3549,7 +3518,6 @@ discard block |
||
3549 | 3518 | * |
3550 | 3519 | * @category Statistical Functions |
3551 | 3520 | * |
3552 | - * @param mixed $arg,... Data values |
|
3553 | 3521 | * |
3554 | 3522 | * @return float |
3555 | 3523 | */ |
@@ -3593,7 +3561,6 @@ discard block |
||
3593 | 3561 | * |
3594 | 3562 | * @category Statistical Functions |
3595 | 3563 | * |
3596 | - * @param mixed $arg,... Data values |
|
3597 | 3564 | * |
3598 | 3565 | * @return float |
3599 | 3566 | */ |
@@ -3646,7 +3613,6 @@ discard block |
||
3646 | 3613 | * |
3647 | 3614 | * @category Statistical Functions |
3648 | 3615 | * |
3649 | - * @param mixed $arg,... Data values |
|
3650 | 3616 | * |
3651 | 3617 | * @return float |
3652 | 3618 | */ |
@@ -3691,7 +3657,6 @@ discard block |
||
3691 | 3657 | * |
3692 | 3658 | * @category Statistical Functions |
3693 | 3659 | * |
3694 | - * @param mixed $arg,... Data values |
|
3695 | 3660 | * |
3696 | 3661 | * @return float |
3697 | 3662 | */ |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | if (!is_numeric($arg)) { |
875 | 875 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
876 | 876 | } |
877 | - $testCondition = '='.$arg.$condition; |
|
877 | + $testCondition = '=' . $arg . $condition; |
|
878 | 878 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
879 | 879 | if ((is_null($returnValue)) || ($arg > $returnValue)) { |
880 | 880 | $returnValue += $arg; |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | if (!is_numeric($arg)) { |
1305 | 1305 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
1306 | 1306 | } |
1307 | - $testCondition = '='.$arg.$condition; |
|
1307 | + $testCondition = '=' . $arg . $condition; |
|
1308 | 1308 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1309 | 1309 | // Is it a value within our criteria |
1310 | 1310 | ++$returnValue; |
@@ -2314,7 +2314,7 @@ discard block |
||
2314 | 2314 | if (!is_numeric($arg)) { |
2315 | 2315 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
2316 | 2316 | } |
2317 | - $testCondition = '='.$arg.$condition; |
|
2317 | + $testCondition = '=' . $arg . $condition; |
|
2318 | 2318 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
2319 | 2319 | if ((is_null($returnValue)) || ($arg > $returnValue)) { |
2320 | 2320 | $returnValue = $arg; |
@@ -2476,7 +2476,7 @@ discard block |
||
2476 | 2476 | if (!is_numeric($arg)) { |
2477 | 2477 | $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); |
2478 | 2478 | } |
2479 | - $testCondition = '='.$arg.$condition; |
|
2479 | + $testCondition = '=' . $arg . $condition; |
|
2480 | 2480 | if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
2481 | 2481 | if ((is_null($returnValue)) || ($arg < $returnValue)) { |
2482 | 2482 | $returnValue = $arg; |
@@ -172,7 +172,7 @@ |
||
172 | 172 | * This function converts a number to text using currency format, with the decimals rounded to the specified place. |
173 | 173 | * The format used is $#,##0.00_);($#,##0.00).. |
174 | 174 | * |
175 | - * @param float $value The value to format |
|
175 | + * @param integer $value The value to format |
|
176 | 176 | * @param int $decimals The number of digits to display to the right of the decimal point. |
177 | 177 | * If decimals is negative, number is rounded to the left of the decimal point. |
178 | 178 | * If you omit decimals, it is assumed to be 2 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return iconv('UCS-4LE', 'UTF-8', pack('V', $character)); |
55 | 55 | } |
56 | 56 | |
57 | - return mb_convert_encoding('&#'.intval($character).';', 'UTF-8', 'HTML-ENTITIES'); |
|
57 | + return mb_convert_encoding('&#' . intval($character) . ';', 'UTF-8', 'HTML-ENTITIES'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | $mask = '$#,##0'; |
194 | 194 | if ($decimals > 0) { |
195 | - $mask .= '.'.str_repeat('0', $decimals); |
|
195 | + $mask .= '.' . str_repeat('0', $decimals); |
|
196 | 196 | } else { |
197 | 197 | $round = pow(10, abs($decimals)); |
198 | 198 | if ($value < 0) { |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $left = self::LEFT($oldText, $start - 1); |
504 | 504 | $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText) - ($start + $chars) + 1); |
505 | 505 | |
506 | - return $left.$newText.$right; |
|
506 | + return $left . $newText . $right; |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | $numberValue = str_replace( |
608 | 608 | \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(), |
609 | 609 | '', |
610 | - trim($value, " \t\n\r\0\x0B".\PhpOffice\PhpSpreadsheet\Shared\StringHelper::getCurrencyCode()) |
|
610 | + trim($value, " \t\n\r\0\x0B" . \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getCurrencyCode()) |
|
611 | 611 | ); |
612 | 612 | if (is_numeric($numberValue)) { |
613 | 613 | return (float) $numberValue; |
@@ -171,6 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | /** |
173 | 173 | * Create a new Chart |
174 | + * @param string $name |
|
174 | 175 | */ |
175 | 176 | public function __construct($name, Title $title = null, Legend $legend = null, PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null) |
176 | 177 | { |
@@ -514,6 +515,9 @@ discard block |
||
514 | 515 | ]; |
515 | 516 | } |
516 | 517 | |
518 | + /** |
|
519 | + * @param integer $xOffset |
|
520 | + */ |
|
517 | 521 | public function setTopLeftXOffset($xOffset) |
518 | 522 | { |
519 | 523 | $this->topLeftXOffset = $xOffset; |
@@ -526,6 +530,9 @@ discard block |
||
526 | 530 | return $this->topLeftXOffset; |
527 | 531 | } |
528 | 532 | |
533 | + /** |
|
534 | + * @param integer $yOffset |
|
535 | + */ |
|
529 | 536 | public function setTopLeftYOffset($yOffset) |
530 | 537 | { |
531 | 538 | $this->topLeftYOffset = $yOffset; |
@@ -622,6 +629,9 @@ discard block |
||
622 | 629 | ]; |
623 | 630 | } |
624 | 631 | |
632 | + /** |
|
633 | + * @param integer $xOffset |
|
634 | + */ |
|
625 | 635 | public function setBottomRightXOffset($xOffset) |
626 | 636 | { |
627 | 637 | $this->bottomRightXOffset = $xOffset; |
@@ -634,6 +644,9 @@ discard block |
||
634 | 644 | return $this->bottomRightXOffset; |
635 | 645 | } |
636 | 646 | |
647 | + /** |
|
648 | + * @param integer $yOffset |
|
649 | + */ |
|
637 | 650 | public function setBottomRightYOffset($yOffset) |
638 | 651 | { |
639 | 652 | $this->bottomRightYOffset = $yOffset; |
@@ -287,6 +287,11 @@ discard block |
||
287 | 287 | return isset($c->v) ? (string) $c->v : null; |
288 | 288 | } |
289 | 289 | |
290 | + /** |
|
291 | + * @param string $r |
|
292 | + * @param string $cellDataType |
|
293 | + * @param string $castBaseType |
|
294 | + */ |
|
290 | 295 | private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) |
291 | 296 | { |
292 | 297 | $cellDataType = 'f'; |
@@ -343,7 +348,7 @@ discard block |
||
343 | 348 | * |
344 | 349 | * @throws Exception |
345 | 350 | * |
346 | - * @return Spreadsheet |
|
351 | + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet |
|
347 | 352 | */ |
348 | 353 | public function load($pFilename) |
349 | 354 | { |
@@ -2010,6 +2015,9 @@ discard block |
||
2010 | 2015 | } |
2011 | 2016 | } |
2012 | 2017 | |
2018 | + /** |
|
2019 | + * @param \PhpOffice\PhpSpreadsheet\Style\Border $docBorder |
|
2020 | + */ |
|
2013 | 2021 | private static function readBorder($docBorder, $eleBorder) |
2014 | 2022 | { |
2015 | 2023 | if (isset($eleBorder['style'])) { |
@@ -2132,6 +2140,9 @@ discard block |
||
2132 | 2140 | return preg_replace('~[^/]+/\.\./~', '', dirname($base)."/$add"); |
2133 | 2141 | } |
2134 | 2142 | |
2143 | + /** |
|
2144 | + * @param string $style |
|
2145 | + */ |
|
2135 | 2146 | private static function toCSSArray($style) |
2136 | 2147 | { |
2137 | 2148 | $style = str_replace(["\r", "\n"], '', $style); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | // Check if file exists |
66 | 66 | if (!file_exists($pFilename)) { |
67 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
67 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | // Check if file exists |
116 | 116 | if (!file_exists($pFilename)) { |
117 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
117 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $worksheetNames = []; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | // Check if file exists |
170 | 170 | if (!file_exists($pFilename)) { |
171 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
171 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $worksheetInfo = []; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $relsWorkbook = simplexml_load_string( |
191 | 191 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
192 | 192 | $this->securityScan( |
193 | - $this->getFromZipArchive($zip, "$dir/_rels/".basename($rel['Target']).'.rels') |
|
193 | + $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels') |
|
194 | 194 | ), |
195 | 195 | 'SimpleXMLElement', |
196 | 196 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $xml = new \XMLReader(); |
229 | 229 | $res = $xml->xml( |
230 | 230 | $this->securityScanFile( |
231 | - 'zip://'.\PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet" |
|
231 | + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . "$dir/$fileWorksheet" |
|
232 | 232 | ), |
233 | 233 | null, |
234 | 234 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | { |
350 | 350 | // Check if file exists |
351 | 351 | if (!file_exists($pFilename)) { |
352 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
352 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | // Initialisations |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $dir = dirname($rel['Target']); |
492 | 492 | $relsWorkbook = simplexml_load_string( |
493 | 493 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
494 | - $this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/".basename($rel['Target']).'.rels')), |
|
494 | + $this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels')), |
|
495 | 495 | 'SimpleXMLElement', |
496 | 496 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
497 | 497 | ); |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | $aKeys = ['sheet', 'objects', 'scenarios', 'formatCells', 'formatColumns', 'formatRows', 'insertColumns', 'insertRows', 'insertHyperlinks', 'deleteColumns', 'deleteRows', 'selectLockedCells', 'sort', 'autoFilter', 'pivotTables', 'selectUnlockedCells']; |
1016 | 1016 | if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { |
1017 | 1017 | foreach ($aKeys as $key) { |
1018 | - $method = 'set'.ucfirst($key); |
|
1018 | + $method = 'set' . ucfirst($key); |
|
1019 | 1019 | $docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key])); |
1020 | 1020 | } |
1021 | 1021 | } |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { |
1219 | 1219 | foreach ($xmlSheet->colBreaks->brk as $brk) { |
1220 | 1220 | if ($brk['man']) { |
1221 | - $docSheet->setBreak(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk['id']).'1', \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN); |
|
1221 | + $docSheet->setBreak(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk['id']) . '1', \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN); |
|
1222 | 1222 | } |
1223 | 1223 | } |
1224 | 1224 | } |
@@ -1257,11 +1257,11 @@ discard block |
||
1257 | 1257 | $hyperlinks = []; |
1258 | 1258 | if (!$this->readDataOnly) { |
1259 | 1259 | // Locate hyperlink relations |
1260 | - if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1260 | + if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1261 | 1261 | $relsWorksheet = simplexml_load_string( |
1262 | 1262 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1263 | 1263 | $this->securityScan( |
1264 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1264 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1265 | 1265 | ), |
1266 | 1266 | 'SimpleXMLElement', |
1267 | 1267 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1284,11 +1284,11 @@ discard block |
||
1284 | 1284 | if (isset($linkRel['id'])) { |
1285 | 1285 | $hyperlinkUrl = $hyperlinks[(string) $linkRel['id']]; |
1286 | 1286 | if (isset($hyperlink['location'])) { |
1287 | - $hyperlinkUrl .= '#'.(string) $hyperlink['location']; |
|
1287 | + $hyperlinkUrl .= '#' . (string) $hyperlink['location']; |
|
1288 | 1288 | } |
1289 | 1289 | $cell->getHyperlink()->setUrl($hyperlinkUrl); |
1290 | 1290 | } elseif (isset($hyperlink['location'])) { |
1291 | - $cell->getHyperlink()->setUrl('sheet://'.(string) $hyperlink['location']); |
|
1291 | + $cell->getHyperlink()->setUrl('sheet://' . (string) $hyperlink['location']); |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | // Tooltip |
@@ -1305,11 +1305,11 @@ discard block |
||
1305 | 1305 | $vmlComments = []; |
1306 | 1306 | if (!$this->readDataOnly) { |
1307 | 1307 | // Locate comment relations |
1308 | - if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1308 | + if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1309 | 1309 | $relsWorksheet = simplexml_load_string( |
1310 | 1310 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1311 | 1311 | $this->securityScan( |
1312 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1312 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1313 | 1313 | ), |
1314 | 1314 | 'SimpleXMLElement', |
1315 | 1315 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | // Loop through comments |
1328 | 1328 | foreach ($comments as $relName => $relPath) { |
1329 | 1329 | // Load comments file |
1330 | - $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet").'/'.$relPath); |
|
1330 | + $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); |
|
1331 | 1331 | $commentsFile = simplexml_load_string( |
1332 | 1332 | $this->securityScan($this->getFromZipArchive($zip, $relPath)), |
1333 | 1333 | 'SimpleXMLElement', |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | // Loop through VML comments |
1355 | 1355 | foreach ($vmlComments as $relName => $relPath) { |
1356 | 1356 | // Load VML comments file |
1357 | - $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet").'/'.$relPath); |
|
1357 | + $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); |
|
1358 | 1358 | $vmlCommentsFile = simplexml_load_string( |
1359 | 1359 | $this->securityScan($this->getFromZipArchive($zip, $relPath)), |
1360 | 1360 | 'SimpleXMLElement', |
@@ -1422,11 +1422,11 @@ discard block |
||
1422 | 1422 | |
1423 | 1423 | // Header/footer images |
1424 | 1424 | if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) { |
1425 | - if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1425 | + if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1426 | 1426 | $relsWorksheet = simplexml_load_string( |
1427 | 1427 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1428 | 1428 | $this->securityScan( |
1429 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1429 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1430 | 1430 | ), |
1431 | 1431 | 'SimpleXMLElement', |
1432 | 1432 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1444,7 +1444,7 @@ discard block |
||
1444 | 1444 | $relsVML = simplexml_load_string( |
1445 | 1445 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1446 | 1446 | $this->securityScan( |
1447 | - $this->getFromZipArchive($zip, dirname($vmlRelationship).'/_rels/'.basename($vmlRelationship).'.rels') |
|
1447 | + $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels') |
|
1448 | 1448 | ), |
1449 | 1449 | 'SimpleXMLElement', |
1450 | 1450 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1480,7 +1480,7 @@ discard block |
||
1480 | 1480 | $hfImages[(string) $shape['id']]->setName((string) $imageData['title']); |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - $hfImages[(string) $shape['id']]->setPath('zip://'.\PhpOffice\PhpSpreadsheet\Shared_File::realpath($pFilename).'#'.$drawings[(string) $imageData['relid']], false); |
|
1483 | + $hfImages[(string) $shape['id']]->setPath('zip://' . \PhpOffice\PhpSpreadsheet\Shared_File::realpath($pFilename) . '#' . $drawings[(string) $imageData['relid']], false); |
|
1484 | 1484 | $hfImages[(string) $shape['id']]->setResizeProportional(false); |
1485 | 1485 | $hfImages[(string) $shape['id']]->setWidth($style['width']); |
1486 | 1486 | $hfImages[(string) $shape['id']]->setHeight($style['height']); |
@@ -1498,11 +1498,11 @@ discard block |
||
1498 | 1498 | } |
1499 | 1499 | |
1500 | 1500 | // TODO: Autoshapes from twoCellAnchors! |
1501 | - if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1501 | + if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1502 | 1502 | $relsWorksheet = simplexml_load_string( |
1503 | 1503 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1504 | 1504 | $this->securityScan( |
1505 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1505 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1506 | 1506 | ), |
1507 | 1507 | 'SimpleXMLElement', |
1508 | 1508 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | $relsDrawing = simplexml_load_string( |
1520 | 1520 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1521 | 1521 | $this->securityScan( |
1522 | - $this->getFromZipArchive($zip, dirname($fileDrawing).'/_rels/'.basename($fileDrawing).'.rels') |
|
1522 | + $this->getFromZipArchive($zip, dirname($fileDrawing) . '/_rels/' . basename($fileDrawing) . '.rels') |
|
1523 | 1523 | ), |
1524 | 1524 | 'SimpleXMLElement', |
1525 | 1525 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
@@ -1556,14 +1556,14 @@ discard block |
||
1556 | 1556 | $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name')); |
1557 | 1557 | $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr')); |
1558 | 1558 | $objDrawing->setPath( |
1559 | - 'zip://'.\PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'. |
|
1559 | + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . |
|
1560 | 1560 | $images[(string) self::getArrayItem( |
1561 | 1561 | $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), |
1562 | 1562 | 'embed' |
1563 | 1563 | )], |
1564 | 1564 | false |
1565 | 1565 | ); |
1566 | - $objDrawing->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col).($oneCellAnchor->from->row + 1)); |
|
1566 | + $objDrawing->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); |
|
1567 | 1567 | $objDrawing->setOffsetX(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff)); |
1568 | 1568 | $objDrawing->setOffsetY(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); |
1569 | 1569 | $objDrawing->setResizeProportional(false); |
@@ -1585,7 +1585,7 @@ discard block |
||
1585 | 1585 | $objDrawing->setWorksheet($docSheet); |
1586 | 1586 | } else { |
1587 | 1587 | // ? Can charts be positioned with a oneCellAnchor ? |
1588 | - $coordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col).($oneCellAnchor->from->row + 1); |
|
1588 | + $coordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); |
|
1589 | 1589 | $offsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff); |
1590 | 1590 | $offsetY = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff); |
1591 | 1591 | $width = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx')); |
@@ -1603,14 +1603,14 @@ discard block |
||
1603 | 1603 | $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name')); |
1604 | 1604 | $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr')); |
1605 | 1605 | $objDrawing->setPath( |
1606 | - 'zip://'.\PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'. |
|
1606 | + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . |
|
1607 | 1607 | $images[(string) self::getArrayItem( |
1608 | 1608 | $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), |
1609 | 1609 | 'embed' |
1610 | 1610 | )], |
1611 | 1611 | false |
1612 | 1612 | ); |
1613 | - $objDrawing->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col).($twoCellAnchor->from->row + 1)); |
|
1613 | + $objDrawing->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); |
|
1614 | 1614 | $objDrawing->setOffsetX(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff)); |
1615 | 1615 | $objDrawing->setOffsetY(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); |
1616 | 1616 | $objDrawing->setResizeProportional(false); |
@@ -1632,17 +1632,17 @@ discard block |
||
1632 | 1632 | } |
1633 | 1633 | $objDrawing->setWorksheet($docSheet); |
1634 | 1634 | } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) { |
1635 | - $fromCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col).($twoCellAnchor->from->row + 1); |
|
1635 | + $fromCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); |
|
1636 | 1636 | $fromOffsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff); |
1637 | 1637 | $fromOffsetY = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff); |
1638 | - $toCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col).($twoCellAnchor->to->row + 1); |
|
1638 | + $toCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); |
|
1639 | 1639 | $toOffsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff); |
1640 | 1640 | $toOffsetY = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff); |
1641 | 1641 | $graphic = $twoCellAnchor->graphicFrame->children('http://schemas.openxmlformats.org/drawingml/2006/main')->graphic; |
1642 | 1642 | $chartRef = $graphic->graphicData->children('http://schemas.openxmlformats.org/drawingml/2006/chart')->chart; |
1643 | 1643 | $thisChart = (string) $chartRef->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); |
1644 | 1644 | |
1645 | - $chartDetails[$docSheet->getTitle().'!'.$thisChart] = [ |
|
1645 | + $chartDetails[$docSheet->getTitle() . '!' . $thisChart] = [ |
|
1646 | 1646 | 'fromCoordinate' => $fromCoordinate, |
1647 | 1647 | 'fromOffsetX' => $fromOffsetX, |
1648 | 1648 | 'fromOffsetY' => $fromOffsetY, |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | // Extract range |
1665 | 1665 | $extractedRange = (string) $definedName; |
1666 | 1666 | if (($spos = strpos($extractedRange, '!')) !== false) { |
1667 | - $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); |
|
1667 | + $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); |
|
1668 | 1668 | } else { |
1669 | 1669 | $extractedRange = str_replace('$', '', $extractedRange); |
1670 | 1670 | } |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | $range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark? |
1715 | 1715 | $rangeSet = isset($range[1]) ? $range[1] : $range[0]; |
1716 | 1716 | if (strpos($rangeSet, ':') === false) { |
1717 | - $rangeSet = $rangeSet.':'.$rangeSet; |
|
1717 | + $rangeSet = $rangeSet . ':' . $rangeSet; |
|
1718 | 1718 | } |
1719 | 1719 | $newRangeSets[] = str_replace('$', '', $rangeSet); |
1720 | 1720 | } |
@@ -1738,7 +1738,7 @@ discard block |
||
1738 | 1738 | // Extract range |
1739 | 1739 | $extractedRange = (string) $definedName; |
1740 | 1740 | if (($spos = strpos($extractedRange, '!')) !== false) { |
1741 | - $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); |
|
1741 | + $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); |
|
1742 | 1742 | } else { |
1743 | 1743 | $extractedRange = str_replace('$', '', $extractedRange); |
1744 | 1744 | } |
@@ -1838,7 +1838,7 @@ discard block |
||
1838 | 1838 | $objChart = \PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); |
1839 | 1839 | |
1840 | 1840 | if (isset($charts[$chartEntryRef])) { |
1841 | - $chartPositionRef = $charts[$chartEntryRef]['sheet'].'!'.$charts[$chartEntryRef]['id']; |
|
1841 | + $chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id']; |
|
1842 | 1842 | if (isset($chartDetails[$chartPositionRef])) { |
1843 | 1843 | $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); |
1844 | 1844 | $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); |
@@ -1870,7 +1870,7 @@ discard block |
||
1870 | 1870 | $returnColour = \PhpOffice\PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust); |
1871 | 1871 | } |
1872 | 1872 | |
1873 | - return 'FF'.$returnColour; |
|
1873 | + return 'FF' . $returnColour; |
|
1874 | 1874 | } |
1875 | 1875 | } |
1876 | 1876 | |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | $customUIImagesNames = []; |
2090 | 2090 | $customUIImagesBinaries = []; |
2091 | 2091 | // something like customUI/_rels/customUI.xml.rels |
2092 | - $pathRels = $baseDir.'/_rels/'.$nameCustomUI.'.rels'; |
|
2092 | + $pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels'; |
|
2093 | 2093 | $dataRels = $this->getFromZipArchive($zip, $pathRels); |
2094 | 2094 | if ($dataRels) { |
2095 | 2095 | // exists and not empty if the ribbon have some pictures (other than internal MSO) |
@@ -2104,7 +2104,7 @@ discard block |
||
2104 | 2104 | if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') { |
2105 | 2105 | // an image ? |
2106 | 2106 | $customUIImagesNames[(string) $ele['Id']] = (string) $ele['Target']; |
2107 | - $customUIImagesBinaries[(string) $ele['Target']] = $this->getFromZipArchive($zip, $baseDir.'/'.(string) $ele['Target']); |
|
2107 | + $customUIImagesBinaries[(string) $ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']); |
|
2108 | 2108 | } |
2109 | 2109 | } |
2110 | 2110 | } |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | |
2130 | 2130 | private static function dirAdd($base, $add) |
2131 | 2131 | { |
2132 | - return preg_replace('~[^/]+/\.\./~', '', dirname($base)."/$add"); |
|
2132 | + return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); |
|
2133 | 2133 | } |
2134 | 2134 | |
2135 | 2135 | private static function toCSSArray($style) |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object. |
171 | 171 | * |
172 | - * @param int|float $excelTimestamp MS Excel serialized date/time value |
|
172 | + * @param integer $excelTimestamp MS Excel serialized date/time value |
|
173 | 173 | * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
174 | 174 | * if you don't want to treat it as a UTC value |
175 | 175 | * Use the default (UST) unless you absolutely need a conversion |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | /** |
211 | 211 | * Convert a MS serialized datetime value from Excel to a unix timestamp. |
212 | 212 | * |
213 | - * @param int|float $excelTimestamp MS Excel serialized date/time value |
|
213 | + * @param integer $excelTimestamp MS Excel serialized date/time value |
|
214 | 214 | * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
215 | 215 | * if you don't want to treat it as a UTC value |
216 | 216 | * Use the default (UST) unless you absolutely need a conversion |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | /** |
229 | 229 | * Convert a date from PHP to an MS Excel serialized date/time value. |
230 | 230 | * |
231 | - * @param mixed $dateValue Unix Timestamp or PHP DateTime object or a string |
|
231 | + * @param integer $dateValue Unix Timestamp or PHP DateTime object or a string |
|
232 | 232 | * |
233 | 233 | * @return float|bool Excel date/time value |
234 | 234 | * or boolean FALSE on failure |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | /** |
269 | 269 | * Convert a Unix timestamp to an MS Excel serialized date/time value. |
270 | 270 | * |
271 | - * @param \DateTimeInterface $dateValue Unix Timestamp |
|
271 | + * @param integer $dateValue Unix Timestamp |
|
272 | 272 | * |
273 | 273 | * @return float MS Excel serialized date/time value |
274 | 274 | */ |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $partDay = $partDay * 60 - $minutes; |
202 | 202 | $seconds = round($partDay * 60); |
203 | 203 | |
204 | - $interval = '+'.$days.' days'; |
|
204 | + $interval = '+' . $days . ' days'; |
|
205 | 205 | |
206 | 206 | return $baseDate->modify($interval) |
207 | 207 | ->setTime($hours, $minutes, $seconds); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | return false; |
279 | 279 | } |
280 | 280 | |
281 | - return self::dateTimeToExcel(new \DateTime('@'.$dateValue)); |
|
281 | + return self::dateTimeToExcel(new \DateTime('@' . $dateValue)); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | return false; |
410 | 410 | } |
411 | 411 | // Try checking for any of the date formatting characters that don't appear within square braces |
412 | - if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $pFormatCode)) { |
|
412 | + if (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $pFormatCode)) { |
|
413 | 413 | // We might also have a format mask containing quoted strings... |
414 | 414 | // we don't want to test for any of our characters within the quoted blocks |
415 | 415 | if (strpos($pFormatCode, '"') !== false) { |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | foreach (explode('"', $pFormatCode) as $subVal) { |
418 | 418 | // Only test in alternate array entries (the non-quoted blocks) |
419 | 419 | if (($segMatcher = !$segMatcher) && |
420 | - (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $subVal))) { |
|
420 | + (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $subVal))) { |
|
421 | 421 | return true; |
422 | 422 | } |
423 | 423 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @param int $pValue Value in pixels |
35 | 35 | * |
36 | - * @return int Value in EMU |
|
36 | + * @return double Value in EMU |
|
37 | 37 | */ |
38 | 38 | public static function pixelsToEMU($pValue = 0) |
39 | 39 | { |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | $header_parts = str_split($header, 2); |
199 | 199 | |
200 | 200 | // Get the width 4 bytes |
201 | - $width = hexdec($header_parts[19].$header_parts[18]); |
|
201 | + $width = hexdec($header_parts[19] . $header_parts[18]); |
|
202 | 202 | |
203 | 203 | // Get the height 4 bytes |
204 | - $height = hexdec($header_parts[23].$header_parts[22]); |
|
204 | + $height = hexdec($header_parts[23] . $header_parts[22]); |
|
205 | 205 | |
206 | 206 | // Unset the header params |
207 | 207 | unset($header_parts); |
@@ -252,9 +252,9 @@ discard block |
||
252 | 252 | // Calculation of the RGB-pixel (defined as BGR in image-data) |
253 | 253 | // Define $i_pos as absolute position in the body |
254 | 254 | $i_pos = $i * 2; |
255 | - $r = hexdec($body[$i_pos + 4].$body[$i_pos + 5]); |
|
256 | - $g = hexdec($body[$i_pos + 2].$body[$i_pos + 3]); |
|
257 | - $b = hexdec($body[$i_pos].$body[$i_pos + 1]); |
|
255 | + $r = hexdec($body[$i_pos + 4] . $body[$i_pos + 5]); |
|
256 | + $g = hexdec($body[$i_pos + 2] . $body[$i_pos + 3]); |
|
257 | + $b = hexdec($body[$i_pos] . $body[$i_pos + 1]); |
|
258 | 258 | |
259 | 259 | // Calculate and draw the pixel |
260 | 260 | $color = imagecolorallocate($image, $r, $g, $b); |
@@ -238,7 +238,7 @@ |
||
238 | 238 | * Calculate an (approximate) OpenXML column width, based on font size and text contained. |
239 | 239 | * |
240 | 240 | * @param \PhpOffice\PhpSpreadsheet\Style\Font $font Font object |
241 | - * @param \PhpOffice\PhpSpreadsheet\RichText|string $cellText Text to calculate width |
|
241 | + * @param string $cellText Text to calculate width |
|
242 | 242 | * @param int $rotation Rotation angle |
243 | 243 | * @param \PhpOffice\PhpSpreadsheet\Style\Font|null $defaultFont Font object |
244 | 244 | * |
@@ -515,11 +515,11 @@ |
||
515 | 515 | ); |
516 | 516 | break; |
517 | 517 | default: |
518 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Unknown font name "'.$name.'". Cannot map to TrueType font file'); |
|
518 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file'); |
|
519 | 519 | break; |
520 | 520 | } |
521 | 521 | |
522 | - $fontFile = self::$trueTypeFontPath.$fontFile; |
|
522 | + $fontFile = self::$trueTypeFontPath . $fontFile; |
|
523 | 523 | |
524 | 524 | // Check if file actually exists |
525 | 525 | if (!file_exists($fontFile)) { |
@@ -228,7 +228,7 @@ |
||
228 | 228 | /** |
229 | 229 | * Solve A*X = B. |
230 | 230 | * |
231 | - * @param $B A Matrix with as many rows as A and any number of columns |
|
231 | + * @param Matrix $B A Matrix with as many rows as A and any number of columns |
|
232 | 232 | * |
233 | 233 | * @throws \PhpOffice\PhpSpreadsheet\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree |
234 | 234 | * @throws \PhpOffice\PhpSpreadsheet\Calculation\Exception RuntimeException Matrix is singular |