PluginProbe
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin / 6.5.1.7
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin v6.5.1.7
6.5.1.7 6.5.1.6 6.5.1.5 6.5.1.4 6.5.1.3 6.5.1.2 6.5.1.1 6.5.0.9 6.5.0.8 6.5.0.7 6.5.0.6 trunk 3.4.2.40 3.4.2.41 3.4.2.42 3.4.2.43 3.4.2.44 3.4.2.45 3.4.2.46 3.4.2.47 3.4.2.48 3.4.2.49 3.4.2.50 6.3.2 6.3.3.1 All 47 releases
wpdatatables / lib / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Calculation / Statistical / AggregateBase.php

AggregateBase.php in wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin 6.5.1.7, at lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/AggregateBase.php

71 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical;
4
5 use PhpOffice\PhpSpreadsheet\Calculation\Functions;
6
7 abstract class AggregateBase
8 {
9 /**
10 * MS Excel does not count Booleans if passed as cell values, but they are counted if passed as literals.
11 * OpenOffice Calc always counts Booleans.
12 * Gnumeric never counts Booleans.
13 *
14 * @param mixed $arg
15 * @param mixed $k
16 *
17 * @return int|mixed
18 */
19 protected static function testAcceptedBoolean($arg, $k)
20 {
21 if (!is_bool($arg)) {
22 return $arg;
23 }
24 if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_GNUMERIC) {
25 return $arg;
26 }
27 if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
28 return (int) $arg;
29 }
30 if (!Functions::isCellValue($k)) {
31 return (int) $arg;
32 }
33 /*if (
34 (is_bool($arg)) &&
35 ((!Functions::isCellValue($k) && (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_EXCEL)) ||
36 (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE))
37 ) {
38 $arg = (int) $arg;
39 }*/
40
41 return $arg;
42 }
43
44 /**
45 * @param mixed $arg
46 * @param mixed $k
47 *
48 * @return bool
49 */
50 protected static function isAcceptedCountable($arg, $k, bool $countNull = false)
51 {
52 if ($countNull && $arg === null && !Functions::isCellValue($k) && Functions::getCompatibilityMode() !== Functions::COMPATIBILITY_GNUMERIC) {
53 return true;
54 }
55 if (!is_numeric($arg)) {
56 return false;
57 }
58 if (!is_string($arg)) {
59 return true;
60 }
61 if (!Functions::isCellValue($k) && Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
62 return true;
63 }
64 if (!Functions::isCellValue($k) && Functions::getCompatibilityMode() !== Functions::COMPATIBILITY_GNUMERIC) {
65 return true;
66 }
67
68 return false;
69 }
70 }
71