Skip to content

Commit

Permalink
MetadataSpreadsheetTrait::getValue(): provide information about a cel…
Browse files Browse the repository at this point in the history
…l if the $cell->getCalculatedValue() fails
  • Loading branch information
zozlak committed Oct 21, 2024
1 parent 9bee338 commit a93afee
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ private function getValue(Cell $cell, PropertyDesc $propDesc,
static $onlyYear = '/^-?[0-9]+$/';

$coordinate = (string) ($this->horizontal ? $cell->getRow() : $cell->getColumn());
$value = trim((string) $cell->getCalculatedValue()); #TODO change to mb_trim() in PHP 8.4
try {
$value = trim((string) $cell->getCalculatedValue()); #TODO change to mb_trim() in PHP 8.4
} catch (\Throwable $e) {
print_r([$cell->getCoordinate(), $cell->getValue()]);
throw $e;
}
if (empty($value)) {
return null;
}
Expand Down

0 comments on commit a93afee

Please sign in to comment.