init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
68
lib/PhpSpreadsheet/Calculation/Information/ErrorValue.php
Normal file
68
lib/PhpSpreadsheet/Calculation/Information/ErrorValue.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation\Information;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
|
||||
|
||||
class ErrorValue
|
||||
{
|
||||
use ArrayEnabled;
|
||||
|
||||
/**
|
||||
* IS_ERR.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* Or can be an array of values
|
||||
*
|
||||
* @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
|
||||
* with the same dimensions
|
||||
*/
|
||||
public static function isErr(mixed $value = ''): array|bool
|
||||
{
|
||||
if (is_array($value)) {
|
||||
return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
|
||||
}
|
||||
|
||||
return self::isError($value) && (!self::isNa(($value)));
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_ERROR.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* Or can be an array of values
|
||||
*
|
||||
* @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
|
||||
* with the same dimensions
|
||||
*/
|
||||
public static function isError(mixed $value = ''): array|bool
|
||||
{
|
||||
if (is_array($value)) {
|
||||
return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
|
||||
}
|
||||
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return in_array($value, ExcelError::ERROR_CODES, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_NA.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* Or can be an array of values
|
||||
*
|
||||
* @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
|
||||
* with the same dimensions
|
||||
*/
|
||||
public static function isNa(mixed $value = ''): array|bool
|
||||
{
|
||||
if (is_array($value)) {
|
||||
return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
|
||||
}
|
||||
|
||||
return $value === ExcelError::NA();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue