PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / Information / ErrorValue.php

ErrorValue.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/Information/ErrorValue.php

73 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
6 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Functions;
7
8 class ErrorValue
9 {
10 use ArrayEnabled;
11
12 /**
13 * IS_ERR.
14 *
15 * @param mixed $value Value to check
16 * Or can be an array of values
17 *
18 * @return array<mixed>|bool If an array of numbers is passed as an argument, then the returned result will also be an array
19 * with the same dimensions
20 */
21 public static function isErr($value = '')
22 {
23 if (is_array($value)) {
24 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
25 }
26
27 return self::isError($value) && (!self::isNa(($value)));
28 }
29
30 /**
31 * IS_ERROR.
32 *
33 * @param mixed $value Value to check
34 * Or can be an array of values
35 *
36 * @return array<mixed>|bool If an array of numbers is passed as an argument, then the returned result will also be an array
37 * with the same dimensions
38 */
39 public static function isError($value = '', bool $tryNotImplemented = false)
40 {
41 if (is_array($value)) {
42 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
43 }
44
45 if (!is_string($value)) {
46 return false;
47 }
48 if ($tryNotImplemented && $value === Functions::NOT_YET_IMPLEMENTED) {
49 return true;
50 }
51
52 return in_array($value, ExcelError::ERROR_CODES, true);
53 }
54
55 /**
56 * IS_NA.
57 *
58 * @param mixed $value Value to check
59 * Or can be an array of values
60 *
61 * @return array<mixed>|bool If an array of numbers is passed as an argument, then the returned result will also be an array
62 * with the same dimensions
63 */
64 public static function isNa($value = '')
65 {
66 if (is_array($value)) {
67 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
68 }
69
70 return $value === ExcelError::NA();
71 }
72 }
73