Skip to content

Commit

Permalink
Add support for PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
TZK- committed Sep 15, 2020
1 parent 449c17b commit ec15ce8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Cell/DefaultValueBinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public static function dataTypeForValue($pValue = null)
return PHPExcel_Cell_DataType::TYPE_STRING;
} elseif ($pValue instanceof PHPExcel_RichText) {
return PHPExcel_Cell_DataType::TYPE_INLINE;
} elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
return PHPExcel_Cell_DataType::TYPE_FORMULA;
} elseif (is_bool($pValue)) {
return PHPExcel_Cell_DataType::TYPE_BOOL;
} elseif (is_float($pValue) || is_int($pValue)) {
return PHPExcel_Cell_DataType::TYPE_NUMERIC;
} elseif (is_string($pValue) && $pValue{0} === '=' && strlen($pValue) > 1) {
return PHPExcel_Cell_DataType::TYPE_FORMULA;
} elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
$tValue = ltrim($pValue, '+-');
if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') {
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/Writer/Excel2007/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ private function writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel
break;
case 'f': // Formula
$attributes = $pCell->getFormulaAttributes();
if ($attributes['t'] == 'array') {
if ($attributes && $attributes['t'] == 'array') {
$objWriter->startElement('f');
$objWriter->writeAttribute('t', 'array');
$objWriter->writeAttribute('ref', $pCellAddress);
Expand Down

0 comments on commit ec15ce8

Please sign in to comment.