See Release Notes
Long Term Support Release
Differences Between: [Versions 400 and 401]
1 <?php 2 3 namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef; 4 5 use PhpOffice\PhpSpreadsheet\Calculation\Exception; 6 use PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue; 7 use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; 8 9 class LookupRefValidations 10 { 11 /** 12 * @param mixed $value 13 */ 14 public static function validateInt($value): int 15 { 16 if (!is_numeric($value)) { 17 if (ErrorValue::isError($value)) { 18 throw new Exception($value); 19 } 20 21 throw new Exception(ExcelError::VALUE()); 22 } 23 24 return (int) floor((float) $value); 25 } 26 27 /** 28 * @param mixed $value 29 */ 30 public static function validatePositiveInt($value, bool $allowZero = true): int 31 { 32 $value = self::validateInt($value); 33 34 if (($allowZero === false && $value <= 0) || $value < 0) { 35 throw new Exception(ExcelError::VALUE()); 36 } 37 38 return $value; 39 } 40 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body