Don't use short list syntax to keep PHP 5.6 compatibility
This commit is contained in:
parent
d3e769202a
commit
440bfe637f
|
@ -47,7 +47,7 @@ return PhpCsFixer\Config::create()
|
||||||
'is_null' => ['use_yoda_style' => false],
|
'is_null' => ['use_yoda_style' => false],
|
||||||
'linebreak_after_opening_tag' => true,
|
'linebreak_after_opening_tag' => true,
|
||||||
'line_ending' => true,
|
'line_ending' => true,
|
||||||
'list_syntax' => ['syntax' => 'short'],
|
'list_syntax' => ['syntax' => 'long'], // Stay compatiblew with PHP 5.6
|
||||||
'lowercase_cast' => true,
|
'lowercase_cast' => true,
|
||||||
'lowercase_constants' => true,
|
'lowercase_constants' => true,
|
||||||
'lowercase_keywords' => true,
|
'lowercase_keywords' => true,
|
||||||
|
|
|
@ -2217,7 +2217,7 @@ class Calculation
|
||||||
// Identify our locale and language
|
// Identify our locale and language
|
||||||
$language = $locale = strtolower($locale);
|
$language = $locale = strtolower($locale);
|
||||||
if (strpos($locale, '_') !== false) {
|
if (strpos($locale, '_') !== false) {
|
||||||
[$language] = explode('_', $locale);
|
list($language) = explode('_', $locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count(self::$validLocaleLanguages) == 1) {
|
if (count(self::$validLocaleLanguages) == 1) {
|
||||||
|
@ -2243,9 +2243,9 @@ class Calculation
|
||||||
// Retrieve the list of locale or language specific function names
|
// Retrieve the list of locale or language specific function names
|
||||||
$localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
foreach ($localeFunctions as $localeFunction) {
|
foreach ($localeFunctions as $localeFunction) {
|
||||||
[$localeFunction] = explode('##', $localeFunction); // Strip out comments
|
list($localeFunction) = explode('##', $localeFunction); // Strip out comments
|
||||||
if (strpos($localeFunction, '=') !== false) {
|
if (strpos($localeFunction, '=') !== false) {
|
||||||
[$fName, $lfName] = explode('=', $localeFunction);
|
list($fName, $lfName) = explode('=', $localeFunction);
|
||||||
$fName = trim($fName);
|
$fName = trim($fName);
|
||||||
$lfName = trim($lfName);
|
$lfName = trim($lfName);
|
||||||
if ((isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
|
if ((isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
|
||||||
|
@ -2268,9 +2268,9 @@ class Calculation
|
||||||
if (file_exists($configFile)) {
|
if (file_exists($configFile)) {
|
||||||
$localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
foreach ($localeSettings as $localeSetting) {
|
foreach ($localeSettings as $localeSetting) {
|
||||||
[$localeSetting] = explode('##', $localeSetting); // Strip out comments
|
list($localeSetting) = explode('##', $localeSetting); // Strip out comments
|
||||||
if (strpos($localeSetting, '=') !== false) {
|
if (strpos($localeSetting, '=') !== false) {
|
||||||
[$settingName, $settingValue] = explode('=', $localeSetting);
|
list($settingName, $settingValue) = explode('=', $localeSetting);
|
||||||
$settingName = strtoupper(trim($settingName));
|
$settingName = strtoupper(trim($settingName));
|
||||||
switch ($settingName) {
|
switch ($settingName) {
|
||||||
case 'ARGUMENTSEPARATOR':
|
case 'ARGUMENTSEPARATOR':
|
||||||
|
@ -2766,17 +2766,17 @@ class Calculation
|
||||||
// Examine each of the two operands, and turn them into an array if they aren't one already
|
// Examine each of the two operands, and turn them into an array if they aren't one already
|
||||||
// Note that this function should only be called if one or both of the operand is already an array
|
// Note that this function should only be called if one or both of the operand is already an array
|
||||||
if (!is_array($operand1)) {
|
if (!is_array($operand1)) {
|
||||||
[$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand2);
|
list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand2);
|
||||||
$operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
|
$operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
|
||||||
$resize = 0;
|
$resize = 0;
|
||||||
} elseif (!is_array($operand2)) {
|
} elseif (!is_array($operand2)) {
|
||||||
[$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand1);
|
list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand1);
|
||||||
$operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
|
$operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
|
||||||
$resize = 0;
|
$resize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[$matrix1Rows, $matrix1Columns] = self::getMatrixDimensions($operand1);
|
list($matrix1Rows, $matrix1Columns) = self::getMatrixDimensions($operand1);
|
||||||
[$matrix2Rows, $matrix2Columns] = self::getMatrixDimensions($operand2);
|
list($matrix2Rows, $matrix2Columns) = self::getMatrixDimensions($operand2);
|
||||||
if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
|
if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
|
||||||
$resize = 1;
|
$resize = 1;
|
||||||
}
|
}
|
||||||
|
@ -3286,14 +3286,14 @@ class Calculation
|
||||||
$startRowColRef = $output[count($output) - 1]['value'];
|
$startRowColRef = $output[count($output) - 1]['value'];
|
||||||
$rangeWS1 = '';
|
$rangeWS1 = '';
|
||||||
if (strpos('!', $startRowColRef) !== false) {
|
if (strpos('!', $startRowColRef) !== false) {
|
||||||
[$rangeWS1, $startRowColRef] = explode('!', $startRowColRef);
|
list($rangeWS1, $startRowColRef) = explode('!', $startRowColRef);
|
||||||
}
|
}
|
||||||
if ($rangeWS1 != '') {
|
if ($rangeWS1 != '') {
|
||||||
$rangeWS1 .= '!';
|
$rangeWS1 .= '!';
|
||||||
}
|
}
|
||||||
$rangeWS2 = $rangeWS1;
|
$rangeWS2 = $rangeWS1;
|
||||||
if (strpos('!', $val) !== false) {
|
if (strpos('!', $val) !== false) {
|
||||||
[$rangeWS2, $val] = explode('!', $val);
|
list($rangeWS2, $val) = explode('!', $val);
|
||||||
}
|
}
|
||||||
if ($rangeWS2 != '') {
|
if ($rangeWS2 != '') {
|
||||||
$rangeWS2 .= '!';
|
$rangeWS2 .= '!';
|
||||||
|
@ -3471,12 +3471,12 @@ class Calculation
|
||||||
case ':': // Range
|
case ':': // Range
|
||||||
$sheet1 = $sheet2 = '';
|
$sheet1 = $sheet2 = '';
|
||||||
if (strpos($operand1Data['reference'], '!') !== false) {
|
if (strpos($operand1Data['reference'], '!') !== false) {
|
||||||
[$sheet1, $operand1Data['reference']] = explode('!', $operand1Data['reference']);
|
list($sheet1, $operand1Data['reference']) = explode('!', $operand1Data['reference']);
|
||||||
} else {
|
} else {
|
||||||
$sheet1 = ($pCellParent !== null) ? $pCellWorksheet->getTitle() : '';
|
$sheet1 = ($pCellParent !== null) ? $pCellWorksheet->getTitle() : '';
|
||||||
}
|
}
|
||||||
if (strpos($operand2Data['reference'], '!') !== false) {
|
if (strpos($operand2Data['reference'], '!') !== false) {
|
||||||
[$sheet2, $operand2Data['reference']] = explode('!', $operand2Data['reference']);
|
list($sheet2, $operand2Data['reference']) = explode('!', $operand2Data['reference']);
|
||||||
} else {
|
} else {
|
||||||
$sheet2 = $sheet1;
|
$sheet2 = $sheet1;
|
||||||
}
|
}
|
||||||
|
@ -4108,7 +4108,7 @@ class Calculation
|
||||||
if ($pSheet !== null) {
|
if ($pSheet !== null) {
|
||||||
$pSheetName = $pSheet->getTitle();
|
$pSheetName = $pSheet->getTitle();
|
||||||
if (strpos($pRange, '!') !== false) {
|
if (strpos($pRange, '!') !== false) {
|
||||||
[$pSheetName, $pRange] = Worksheet::extractSheetTitle($pRange, true);
|
list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true);
|
||||||
$pSheet = $this->spreadsheet->getSheetByName($pSheetName);
|
$pSheet = $this->spreadsheet->getSheetByName($pSheetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4159,7 +4159,7 @@ class Calculation
|
||||||
if ($pSheet !== null) {
|
if ($pSheet !== null) {
|
||||||
$pSheetName = $pSheet->getTitle();
|
$pSheetName = $pSheet->getTitle();
|
||||||
if (strpos($pRange, '!') !== false) {
|
if (strpos($pRange, '!') !== false) {
|
||||||
[$pSheetName, $pRange] = Worksheet::extractSheetTitle($pRange, true);
|
list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true);
|
||||||
$pSheet = $this->spreadsheet->getSheetByName($pSheetName);
|
$pSheet = $this->spreadsheet->getSheetByName($pSheetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4183,7 +4183,7 @@ class Calculation
|
||||||
$aReferences = Cell::extractAllCellReferencesInRange($pRange);
|
$aReferences = Cell::extractAllCellReferencesInRange($pRange);
|
||||||
if (!isset($aReferences[1])) {
|
if (!isset($aReferences[1])) {
|
||||||
// Single cell (or single column or row) in range
|
// Single cell (or single column or row) in range
|
||||||
[$currentCol, $currentRow] = Cell::coordinateFromString($aReferences[0]);
|
list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]);
|
||||||
if ($pSheet->cellExists($aReferences[0])) {
|
if ($pSheet->cellExists($aReferences[0])) {
|
||||||
$returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
|
$returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4193,7 +4193,7 @@ class Calculation
|
||||||
// Extract cell data for all cells in the range
|
// Extract cell data for all cells in the range
|
||||||
foreach ($aReferences as $reference) {
|
foreach ($aReferences as $reference) {
|
||||||
// Extract range
|
// Extract range
|
||||||
[$currentCol, $currentRow] = Cell::coordinateFromString($reference);
|
list($currentCol, $currentRow) = Cell::coordinateFromString($reference);
|
||||||
if ($pSheet->cellExists($reference)) {
|
if ($pSheet->cellExists($reference)) {
|
||||||
$returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
|
$returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -278,7 +278,7 @@ class Functions
|
||||||
return '=' . $condition;
|
return '=' . $condition;
|
||||||
}
|
}
|
||||||
preg_match('/([<>=]+)(.*)/', $condition, $matches);
|
preg_match('/([<>=]+)(.*)/', $condition, $matches);
|
||||||
[, $operator, $operand] = $matches;
|
list(, $operator, $operand) = $matches;
|
||||||
|
|
||||||
if (!is_numeric($operand)) {
|
if (!is_numeric($operand)) {
|
||||||
$operand = str_replace('"', '""', $operand);
|
$operand = str_replace('"', '""', $operand);
|
||||||
|
|
|
@ -103,10 +103,10 @@ class LookupRef
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (strpos($cellAddress, '!') !== false) {
|
if (strpos($cellAddress, '!') !== false) {
|
||||||
[$sheet, $cellAddress] = explode('!', $cellAddress);
|
list($sheet, $cellAddress) = explode('!', $cellAddress);
|
||||||
}
|
}
|
||||||
if (strpos($cellAddress, ':') !== false) {
|
if (strpos($cellAddress, ':') !== false) {
|
||||||
[$startAddress, $endAddress] = explode(':', $cellAddress);
|
list($startAddress, $endAddress) = explode(':', $cellAddress);
|
||||||
$startAddress = preg_replace('/[^a-z]/i', '', $startAddress);
|
$startAddress = preg_replace('/[^a-z]/i', '', $startAddress);
|
||||||
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
|
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
|
@ -145,7 +145,7 @@ class LookupRef
|
||||||
|
|
||||||
reset($cellAddress);
|
reset($cellAddress);
|
||||||
$isMatrix = (is_numeric(key($cellAddress)));
|
$isMatrix = (is_numeric(key($cellAddress)));
|
||||||
[$columns, $rows] = Calculation::_getMatrixDimensions($cellAddress);
|
list($columns, $rows) = Calculation::_getMatrixDimensions($cellAddress);
|
||||||
|
|
||||||
if ($isMatrix) {
|
if ($isMatrix) {
|
||||||
return $rows;
|
return $rows;
|
||||||
|
@ -184,10 +184,10 @@ class LookupRef
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (strpos($cellAddress, '!') !== false) {
|
if (strpos($cellAddress, '!') !== false) {
|
||||||
[$sheet, $cellAddress] = explode('!', $cellAddress);
|
list($sheet, $cellAddress) = explode('!', $cellAddress);
|
||||||
}
|
}
|
||||||
if (strpos($cellAddress, ':') !== false) {
|
if (strpos($cellAddress, ':') !== false) {
|
||||||
[$startAddress, $endAddress] = explode(':', $cellAddress);
|
list($startAddress, $endAddress) = explode(':', $cellAddress);
|
||||||
$startAddress = preg_replace('/[^0-9]/', '', $startAddress);
|
$startAddress = preg_replace('/[^0-9]/', '', $startAddress);
|
||||||
$endAddress = preg_replace('/[^0-9]/', '', $endAddress);
|
$endAddress = preg_replace('/[^0-9]/', '', $endAddress);
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
|
@ -197,7 +197,7 @@ class LookupRef
|
||||||
|
|
||||||
return $returnValue;
|
return $returnValue;
|
||||||
}
|
}
|
||||||
[$cellAddress] = explode(':', $cellAddress);
|
list($cellAddress) = explode(':', $cellAddress);
|
||||||
|
|
||||||
return (int) preg_replace('/[^0-9]/', '', $cellAddress);
|
return (int) preg_replace('/[^0-9]/', '', $cellAddress);
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ class LookupRef
|
||||||
|
|
||||||
reset($cellAddress);
|
reset($cellAddress);
|
||||||
$isMatrix = (is_numeric(key($cellAddress)));
|
$isMatrix = (is_numeric(key($cellAddress)));
|
||||||
[$columns, $rows] = Calculation::_getMatrixDimensions($cellAddress);
|
list($columns, $rows) = Calculation::_getMatrixDimensions($cellAddress);
|
||||||
|
|
||||||
if ($isMatrix) {
|
if ($isMatrix) {
|
||||||
return $columns;
|
return $columns;
|
||||||
|
@ -296,7 +296,7 @@ class LookupRef
|
||||||
$cellAddress1 = $cellAddress;
|
$cellAddress1 = $cellAddress;
|
||||||
$cellAddress2 = null;
|
$cellAddress2 = null;
|
||||||
if (strpos($cellAddress, ':') !== false) {
|
if (strpos($cellAddress, ':') !== false) {
|
||||||
[$cellAddress1, $cellAddress2] = explode(':', $cellAddress);
|
list($cellAddress1, $cellAddress2) = explode(':', $cellAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) ||
|
if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) ||
|
||||||
|
@ -306,7 +306,7 @@ class LookupRef
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($cellAddress, '!') !== false) {
|
if (strpos($cellAddress, '!') !== false) {
|
||||||
[$sheetName, $cellAddress] = explode('!', $cellAddress);
|
list($sheetName, $cellAddress) = explode('!', $cellAddress);
|
||||||
$sheetName = trim($sheetName, "'");
|
$sheetName = trim($sheetName, "'");
|
||||||
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -317,7 +317,7 @@ class LookupRef
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($cellAddress, '!') !== false) {
|
if (strpos($cellAddress, '!') !== false) {
|
||||||
[$sheetName, $cellAddress] = explode('!', $cellAddress);
|
list($sheetName, $cellAddress) = explode('!', $cellAddress);
|
||||||
$sheetName = trim($sheetName, "'");
|
$sheetName = trim($sheetName, "'");
|
||||||
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -375,16 +375,16 @@ class LookupRef
|
||||||
|
|
||||||
$sheetName = null;
|
$sheetName = null;
|
||||||
if (strpos($cellAddress, '!')) {
|
if (strpos($cellAddress, '!')) {
|
||||||
[$sheetName, $cellAddress] = explode('!', $cellAddress);
|
list($sheetName, $cellAddress) = explode('!', $cellAddress);
|
||||||
$sheetName = trim($sheetName, "'");
|
$sheetName = trim($sheetName, "'");
|
||||||
}
|
}
|
||||||
if (strpos($cellAddress, ':')) {
|
if (strpos($cellAddress, ':')) {
|
||||||
[$startCell, $endCell] = explode(':', $cellAddress);
|
list($startCell, $endCell) = explode(':', $cellAddress);
|
||||||
} else {
|
} else {
|
||||||
$startCell = $endCell = $cellAddress;
|
$startCell = $endCell = $cellAddress;
|
||||||
}
|
}
|
||||||
[$startCellColumn, $startCellRow] = Cell::coordinateFromString($startCell);
|
list($startCellColumn, $startCellRow) = Cell::coordinateFromString($startCell);
|
||||||
[$endCellColumn, $endCellRow] = Cell::coordinateFromString($endCell);
|
list($endCellColumn, $endCellRow) = Cell::coordinateFromString($endCell);
|
||||||
|
|
||||||
$startCellRow += $rows;
|
$startCellRow += $rows;
|
||||||
$startCellColumn = Cell::columnIndexFromString($startCellColumn) - 1;
|
$startCellColumn = Cell::columnIndexFromString($startCellColumn) - 1;
|
||||||
|
|
|
@ -1110,7 +1110,7 @@ class MathTrig
|
||||||
return array_filter(
|
return array_filter(
|
||||||
$args,
|
$args,
|
||||||
function ($index) use ($cellReference) {
|
function ($index) use ($cellReference) {
|
||||||
[, $row, $column] = explode('.', $index);
|
list(, $row, $column) = explode('.', $index);
|
||||||
|
|
||||||
return $cellReference->getWorksheet()->getRowDimension($row)->getVisible() &&
|
return $cellReference->getWorksheet()->getRowDimension($row)->getVisible() &&
|
||||||
$cellReference->getWorksheet()->getColumnDimension($column)->getVisible();
|
$cellReference->getWorksheet()->getColumnDimension($column)->getVisible();
|
||||||
|
|
|
@ -500,7 +500,7 @@ class Cell
|
||||||
{
|
{
|
||||||
if ($mergeRange = $this->getMergeRange()) {
|
if ($mergeRange = $this->getMergeRange()) {
|
||||||
$mergeRange = self::splitRange($mergeRange);
|
$mergeRange = self::splitRange($mergeRange);
|
||||||
[$startCell] = $mergeRange[0];
|
list($startCell) = $mergeRange[0];
|
||||||
if ($this->getCoordinate() === $startCell) {
|
if ($this->getCoordinate() === $startCell) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -558,7 +558,7 @@ class Cell
|
||||||
*/
|
*/
|
||||||
public function isInRange($pRange)
|
public function isInRange($pRange)
|
||||||
{
|
{
|
||||||
[$rangeStart, $rangeEnd] = self::rangeBoundaries($pRange);
|
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
||||||
|
|
||||||
// Translate properties
|
// Translate properties
|
||||||
$myColumn = self::columnIndexFromString($this->getColumn());
|
$myColumn = self::columnIndexFromString($this->getColumn());
|
||||||
|
@ -608,7 +608,7 @@ class Cell
|
||||||
$worksheet = '';
|
$worksheet = '';
|
||||||
$cellAddress = explode('!', $pCoordinateString);
|
$cellAddress = explode('!', $pCoordinateString);
|
||||||
if (count($cellAddress) > 1) {
|
if (count($cellAddress) > 1) {
|
||||||
[$worksheet, $pCoordinateString] = $cellAddress;
|
list($worksheet, $pCoordinateString) = $cellAddress;
|
||||||
}
|
}
|
||||||
if ($worksheet > '') {
|
if ($worksheet > '') {
|
||||||
$worksheet .= '!';
|
$worksheet .= '!';
|
||||||
|
@ -643,14 +643,14 @@ class Cell
|
||||||
$worksheet = '';
|
$worksheet = '';
|
||||||
$cellAddress = explode('!', $pCoordinateString);
|
$cellAddress = explode('!', $pCoordinateString);
|
||||||
if (count($cellAddress) > 1) {
|
if (count($cellAddress) > 1) {
|
||||||
[$worksheet, $pCoordinateString] = $cellAddress;
|
list($worksheet, $pCoordinateString) = $cellAddress;
|
||||||
}
|
}
|
||||||
if ($worksheet > '') {
|
if ($worksheet > '') {
|
||||||
$worksheet .= '!';
|
$worksheet .= '!';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create absolute coordinate
|
// Create absolute coordinate
|
||||||
[$column, $row] = self::coordinateFromString($pCoordinateString);
|
list($column, $row) = self::coordinateFromString($pCoordinateString);
|
||||||
$column = ltrim($column, '$');
|
$column = ltrim($column, '$');
|
||||||
$row = ltrim($row, '$');
|
$row = ltrim($row, '$');
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ class Cell
|
||||||
if (strpos($pRange, ':') === false) {
|
if (strpos($pRange, ':') === false) {
|
||||||
$rangeA = $rangeB = $pRange;
|
$rangeA = $rangeB = $pRange;
|
||||||
} else {
|
} else {
|
||||||
[$rangeA, $rangeB] = explode(':', $pRange);
|
list($rangeA, $rangeB) = explode(':', $pRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
|
@ -758,7 +758,7 @@ class Cell
|
||||||
public static function rangeDimension($pRange)
|
public static function rangeDimension($pRange)
|
||||||
{
|
{
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
[$rangeStart, $rangeEnd] = self::rangeBoundaries($pRange);
|
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
||||||
|
|
||||||
return [($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1)];
|
return [($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1)];
|
||||||
}
|
}
|
||||||
|
@ -785,7 +785,7 @@ class Cell
|
||||||
if (strpos($pRange, ':') === false) {
|
if (strpos($pRange, ':') === false) {
|
||||||
$rangeA = $rangeB = $pRange;
|
$rangeA = $rangeB = $pRange;
|
||||||
} else {
|
} else {
|
||||||
[$rangeA, $rangeB] = explode(':', $pRange);
|
list($rangeA, $rangeB) = explode(':', $pRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)];
|
return [self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)];
|
||||||
|
@ -897,7 +897,7 @@ class Cell
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range...
|
// Range...
|
||||||
[$rangeStart, $rangeEnd] = $range;
|
list($rangeStart, $rangeEnd) = $range;
|
||||||
sscanf($rangeStart, '%[A-Z]%d', $startCol, $startRow);
|
sscanf($rangeStart, '%[A-Z]%d', $startCol, $startRow);
|
||||||
sscanf($rangeEnd, '%[A-Z]%d', $endCol, $endRow);
|
sscanf($rangeEnd, '%[A-Z]%d', $endCol, $endRow);
|
||||||
++$endCol;
|
++$endCol;
|
||||||
|
@ -952,7 +952,7 @@ class Cell
|
||||||
$hashedValues = [];
|
$hashedValues = [];
|
||||||
|
|
||||||
foreach ($pCoordCollection as $coord => $value) {
|
foreach ($pCoordCollection as $coord => $value) {
|
||||||
[$column, $row] = self::coordinateFromString($coord);
|
list($column, $row) = self::coordinateFromString($coord);
|
||||||
$row = (int) (ltrim($row, '$'));
|
$row = (int) (ltrim($row, '$'));
|
||||||
$hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value);
|
$hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value);
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
|
||||||
// Check for time without seconds e.g. '9:45', '09:45'
|
// Check for time without seconds e.g. '9:45', '09:45'
|
||||||
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
|
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
|
||||||
// Convert value to number
|
// Convert value to number
|
||||||
[$h, $m] = explode(':', $value);
|
list($h, $m) = explode(':', $value);
|
||||||
$days = $h / 24 + $m / 1440;
|
$days = $h / 24 + $m / 1440;
|
||||||
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
||||||
// Set style
|
// Set style
|
||||||
|
@ -130,7 +130,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
|
||||||
// Check for time with seconds '9:45:59', '09:45:59'
|
// Check for time with seconds '9:45:59', '09:45:59'
|
||||||
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
|
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
|
||||||
// Convert value to number
|
// Convert value to number
|
||||||
[$h, $m, $s] = explode(':', $value);
|
list($h, $m, $s) = explode(':', $value);
|
||||||
$days = $h / 24 + $m / 1440 + $s / 86400;
|
$days = $h / 24 + $m / 1440 + $s / 86400;
|
||||||
// Convert value to number
|
// Convert value to number
|
||||||
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
||||||
|
|
|
@ -324,7 +324,7 @@ class DataSeriesValues
|
||||||
} else {
|
} else {
|
||||||
$cellRange = explode('!', $this->dataSource);
|
$cellRange = explode('!', $this->dataSource);
|
||||||
if (count($cellRange) > 1) {
|
if (count($cellRange) > 1) {
|
||||||
[, $cellRange] = $cellRange;
|
list(, $cellRange) = $cellRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dimensions = Cell::rangeDimension(str_replace('$', '', $cellRange));
|
$dimensions = Cell::rangeDimension(str_replace('$', '', $cellRange));
|
||||||
|
|
|
@ -405,7 +405,7 @@ class JpGraph
|
||||||
$seriesPlot->link->SetColor(self::$colourSet[self::$plotColour]);
|
$seriesPlot->link->SetColor(self::$colourSet[self::$plotColour]);
|
||||||
} elseif ($scatterStyle == 'smoothMarker') {
|
} elseif ($scatterStyle == 'smoothMarker') {
|
||||||
$spline = new Spline($dataValuesY, $dataValuesX);
|
$spline = new Spline($dataValuesY, $dataValuesX);
|
||||||
[$splineDataY, $splineDataX] = $spline->Get(count($dataValuesX) * self::$width / 20);
|
list($splineDataY, $splineDataX) = $spline->Get(count($dataValuesX) * self::$width / 20);
|
||||||
$lplot = new LinePlot($splineDataX, $splineDataY);
|
$lplot = new LinePlot($splineDataX, $splineDataY);
|
||||||
$lplot->SetColor(self::$colourSet[self::$plotColour]);
|
$lplot->SetColor(self::$colourSet[self::$plotColour]);
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@ class Gnumeric extends BaseReader implements IReader
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'user-defined':
|
case 'user-defined':
|
||||||
[, $attrName] = explode(':', $attributes['name']);
|
list(, $attrName) = explode(':', $attributes['name']);
|
||||||
switch ($attrName) {
|
switch ($attrName) {
|
||||||
case 'publisher':
|
case 'publisher':
|
||||||
$docProps->setCompany(trim($propertyValue));
|
$docProps->setCompany(trim($propertyValue));
|
||||||
|
@ -888,7 +888,7 @@ class Gnumeric extends BaseReader implements IReader
|
||||||
|
|
||||||
private static function parseGnumericColour($gnmColour)
|
private static function parseGnumericColour($gnmColour)
|
||||||
{
|
{
|
||||||
[$gnmR, $gnmG, $gnmB] = explode(':', $gnmColour);
|
list($gnmR, $gnmG, $gnmB) = explode(':', $gnmColour);
|
||||||
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
|
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||||
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);
|
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||||
$gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2);
|
$gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||||
|
|
|
@ -591,7 +591,7 @@ class Ods extends BaseReader implements IReader
|
||||||
|
|
||||||
$dateObj = new DateTime($value, $GMT);
|
$dateObj = new DateTime($value, $GMT);
|
||||||
$dateObj->setTimeZone($timezoneObj);
|
$dateObj->setTimeZone($timezoneObj);
|
||||||
[$year, $month, $day, $hour, $minute, $second] = explode(
|
list($year, $month, $day, $hour, $minute, $second) = explode(
|
||||||
' ',
|
' ',
|
||||||
$dateObj->format('Y m d H i s')
|
$dateObj->format('Y m d H i s')
|
||||||
);
|
);
|
||||||
|
|
|
@ -385,7 +385,7 @@ class Slk extends BaseReader implements IReader
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'W':
|
case 'W':
|
||||||
[$startCol, $endCol, $columnWidth] = explode(' ', substr($rowDatum, 1));
|
list($startCol, $endCol, $columnWidth) = explode(' ', substr($rowDatum, 1));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
|
|
|
@ -1085,8 +1085,8 @@ class Xls extends BaseReader implements IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the width and height of the shape
|
// calculate the width and height of the shape
|
||||||
[$startColumn, $startRow] = Cell::coordinateFromString($spContainer->getStartCoordinates());
|
list($startColumn, $startRow) = Cell::coordinateFromString($spContainer->getStartCoordinates());
|
||||||
[$endColumn, $endRow] = Cell::coordinateFromString($spContainer->getEndCoordinates());
|
list($endColumn, $endRow) = Cell::coordinateFromString($spContainer->getEndCoordinates());
|
||||||
|
|
||||||
$startOffsetX = $spContainer->getStartOffsetX();
|
$startOffsetX = $spContainer->getStartOffsetX();
|
||||||
$startOffsetY = $spContainer->getStartOffsetY();
|
$startOffsetY = $spContainer->getStartOffsetY();
|
||||||
|
@ -1171,7 +1171,7 @@ class Xls extends BaseReader implements IReader
|
||||||
// treat SHAREDFMLA records
|
// treat SHAREDFMLA records
|
||||||
if ($this->version == self::XLS_BIFF8) {
|
if ($this->version == self::XLS_BIFF8) {
|
||||||
foreach ($this->sharedFormulaParts as $cell => $baseCell) {
|
foreach ($this->sharedFormulaParts as $cell => $baseCell) {
|
||||||
[$column, $row] = Cell::coordinateFromString($cell);
|
list($column, $row) = Cell::coordinateFromString($cell);
|
||||||
if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) {
|
if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) {
|
||||||
$formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell);
|
$formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell);
|
||||||
$this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, Cell\DataType::TYPE_FORMULA);
|
$this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, Cell\DataType::TYPE_FORMULA);
|
||||||
|
@ -1247,8 +1247,8 @@ class Xls extends BaseReader implements IReader
|
||||||
|
|
||||||
$coordinateStrings = explode(':', $extractedRange);
|
$coordinateStrings = explode(':', $extractedRange);
|
||||||
if (count($coordinateStrings) == 2) {
|
if (count($coordinateStrings) == 2) {
|
||||||
[$firstColumn, $firstRow] = Cell::coordinateFromString($coordinateStrings[0]);
|
list($firstColumn, $firstRow) = Cell::coordinateFromString($coordinateStrings[0]);
|
||||||
[$lastColumn, $lastRow] = Cell::coordinateFromString($coordinateStrings[1]);
|
list($lastColumn, $lastRow) = Cell::coordinateFromString($coordinateStrings[1]);
|
||||||
|
|
||||||
if ($firstColumn == 'A' and $lastColumn == 'IV') {
|
if ($firstColumn == 'A' and $lastColumn == 'IV') {
|
||||||
// then we have repeating rows
|
// then we have repeating rows
|
||||||
|
@ -7201,7 +7201,7 @@ class Xls extends BaseReader implements IReader
|
||||||
*/
|
*/
|
||||||
private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1')
|
private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1')
|
||||||
{
|
{
|
||||||
[$baseCol, $baseRow] = Cell::coordinateFromString($baseCell);
|
list($baseCol, $baseRow) = Cell::coordinateFromString($baseCell);
|
||||||
$baseCol = Cell::columnIndexFromString($baseCol) - 1;
|
$baseCol = Cell::columnIndexFromString($baseCol) - 1;
|
||||||
|
|
||||||
// offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767))
|
// offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767))
|
||||||
|
@ -7384,7 +7384,7 @@ class Xls extends BaseReader implements IReader
|
||||||
*/
|
*/
|
||||||
private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1')
|
private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1')
|
||||||
{
|
{
|
||||||
[$baseCol, $baseRow] = Cell::coordinateFromString($baseCell);
|
list($baseCol, $baseRow) = Cell::coordinateFromString($baseCell);
|
||||||
$baseCol = Cell::columnIndexFromString($baseCol) - 1;
|
$baseCol = Cell::columnIndexFromString($baseCol) - 1;
|
||||||
|
|
||||||
// TODO: if cell range is just a single cell, should this funciton
|
// TODO: if cell range is just a single cell, should this funciton
|
||||||
|
|
|
@ -122,7 +122,7 @@ class ReferenceHelper
|
||||||
*/
|
*/
|
||||||
private static function cellAddressInDeleteRange($cellAddress, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)
|
private static function cellAddressInDeleteRange($cellAddress, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)
|
||||||
{
|
{
|
||||||
[$cellColumn, $cellRow] = Cell::coordinateFromString($cellAddress);
|
list($cellColumn, $cellRow) = Cell::coordinateFromString($cellAddress);
|
||||||
$cellColumnIndex = Cell::columnIndexFromString($cellColumn);
|
$cellColumnIndex = Cell::columnIndexFromString($cellColumn);
|
||||||
// Is cell within the range of rows/columns if we're deleting
|
// Is cell within the range of rows/columns if we're deleting
|
||||||
if ($pNumRows < 0 &&
|
if ($pNumRows < 0 &&
|
||||||
|
@ -309,7 +309,7 @@ class ReferenceHelper
|
||||||
if (!empty($aColumnDimensions)) {
|
if (!empty($aColumnDimensions)) {
|
||||||
foreach ($aColumnDimensions as $objColumnDimension) {
|
foreach ($aColumnDimensions as $objColumnDimension) {
|
||||||
$newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows);
|
$newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows);
|
||||||
[$newReference] = Cell::coordinateFromString($newReference);
|
list($newReference) = Cell::coordinateFromString($newReference);
|
||||||
if ($objColumnDimension->getColumnIndex() != $newReference) {
|
if ($objColumnDimension->getColumnIndex() != $newReference) {
|
||||||
$objColumnDimension->setColumnIndex($newReference);
|
$objColumnDimension->setColumnIndex($newReference);
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ class ReferenceHelper
|
||||||
if (!empty($aRowDimensions)) {
|
if (!empty($aRowDimensions)) {
|
||||||
foreach ($aRowDimensions as $objRowDimension) {
|
foreach ($aRowDimensions as $objRowDimension) {
|
||||||
$newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
|
$newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
|
||||||
[, $newReference] = Cell::coordinateFromString($newReference);
|
list(, $newReference) = Cell::coordinateFromString($newReference);
|
||||||
if ($objRowDimension->getRowIndex() != $newReference) {
|
if ($objRowDimension->getRowIndex() != $newReference) {
|
||||||
$objRowDimension->setRowIndex($newReference);
|
$objRowDimension->setRowIndex($newReference);
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ class ReferenceHelper
|
||||||
// Get coordinate of $pBefore
|
// Get coordinate of $pBefore
|
||||||
$beforeColumn = 'A';
|
$beforeColumn = 'A';
|
||||||
$beforeRow = 1;
|
$beforeRow = 1;
|
||||||
[$beforeColumn, $beforeRow] = Cell::coordinateFromString($pBefore);
|
list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore);
|
||||||
$beforeColumnIndex = Cell::columnIndexFromString($beforeColumn);
|
$beforeColumnIndex = Cell::columnIndexFromString($beforeColumn);
|
||||||
|
|
||||||
// Clear cells if we are removing columns or rows
|
// Clear cells if we are removing columns or rows
|
||||||
|
@ -529,7 +529,7 @@ class ReferenceHelper
|
||||||
if (count($autoFilterColumns) > 0) {
|
if (count($autoFilterColumns) > 0) {
|
||||||
sscanf($pBefore, '%[A-Z]%d', $column, $row);
|
sscanf($pBefore, '%[A-Z]%d', $column, $row);
|
||||||
$columnIndex = Cell::columnIndexFromString($column);
|
$columnIndex = Cell::columnIndexFromString($column);
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($autoFilterRange);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($autoFilterRange);
|
||||||
if ($columnIndex <= $rangeEnd[0]) {
|
if ($columnIndex <= $rangeEnd[0]) {
|
||||||
if ($pNumCols < 0) {
|
if ($pNumCols < 0) {
|
||||||
// If we're actually deleting any columns that fall within the autofilter range,
|
// If we're actually deleting any columns that fall within the autofilter range,
|
||||||
|
@ -696,7 +696,7 @@ class ReferenceHelper
|
||||||
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
|
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
|
||||||
$toString = ($match[2] > '') ? $match[2] . '!' : '';
|
$toString = ($match[2] > '') ? $match[2] . '!' : '';
|
||||||
$toString .= $modified3 . ':' . $modified4;
|
$toString .= $modified3 . ':' . $modified4;
|
||||||
[$column, $row] = Cell::coordinateFromString($match[3]);
|
list($column, $row) = Cell::coordinateFromString($match[3]);
|
||||||
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
|
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
|
||||||
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
|
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
|
||||||
$row = trim($row, '$') + 10000000;
|
$row = trim($row, '$') + 10000000;
|
||||||
|
@ -722,7 +722,7 @@ class ReferenceHelper
|
||||||
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
|
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
|
||||||
$toString = ($match[2] > '') ? $match[2] . '!' : '';
|
$toString = ($match[2] > '') ? $match[2] . '!' : '';
|
||||||
$toString .= $modified3;
|
$toString .= $modified3;
|
||||||
[$column, $row] = Cell::coordinateFromString($match[3]);
|
list($column, $row) = Cell::coordinateFromString($match[3]);
|
||||||
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
|
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
|
||||||
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
|
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
|
||||||
$row = trim($row, '$') + 10000000;
|
$row = trim($row, '$') + 10000000;
|
||||||
|
@ -866,10 +866,10 @@ class ReferenceHelper
|
||||||
{
|
{
|
||||||
if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
|
if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
|
||||||
// Get coordinate of $pBefore
|
// Get coordinate of $pBefore
|
||||||
[$beforeColumn, $beforeRow] = Cell::coordinateFromString($pBefore);
|
list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore);
|
||||||
|
|
||||||
// Get coordinate of $pCellReference
|
// Get coordinate of $pCellReference
|
||||||
[$newColumn, $newRow] = Cell::coordinateFromString($pCellReference);
|
list($newColumn, $newRow) = Cell::coordinateFromString($pCellReference);
|
||||||
|
|
||||||
// Verify which parts should be updated
|
// Verify which parts should be updated
|
||||||
$updateColumn = (($newColumn[0] != '$') && ($beforeColumn[0] != '$') && (Cell::columnIndexFromString($newColumn) >= Cell::columnIndexFromString($beforeColumn)));
|
$updateColumn = (($newColumn[0] != '$') && ($beforeColumn[0] != '$') && (Cell::columnIndexFromString($newColumn) >= Cell::columnIndexFromString($beforeColumn)));
|
||||||
|
|
|
@ -171,7 +171,7 @@ class Matrix
|
||||||
switch ($match) {
|
switch ($match) {
|
||||||
//A($i0...; $j0...)
|
//A($i0...; $j0...)
|
||||||
case 'integer,integer':
|
case 'integer,integer':
|
||||||
[$i0, $j0] = $args;
|
list($i0, $j0) = $args;
|
||||||
if ($i0 >= 0) {
|
if ($i0 >= 0) {
|
||||||
$m = $this->m - $i0;
|
$m = $this->m - $i0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -193,7 +193,7 @@ class Matrix
|
||||||
break;
|
break;
|
||||||
//A($i0...$iF; $j0...$jF)
|
//A($i0...$iF; $j0...$jF)
|
||||||
case 'integer,integer,integer,integer':
|
case 'integer,integer,integer,integer':
|
||||||
[$i0, $iF, $j0, $jF] = $args;
|
list($i0, $iF, $j0, $jF) = $args;
|
||||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
||||||
$m = $iF - $i0;
|
$m = $iF - $i0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -215,7 +215,7 @@ class Matrix
|
||||||
break;
|
break;
|
||||||
//$R = array of row indices; $C = array of column indices
|
//$R = array of row indices; $C = array of column indices
|
||||||
case 'array,array':
|
case 'array,array':
|
||||||
[$RL, $CL] = $args;
|
list($RL, $CL) = $args;
|
||||||
if (count($RL) > 0) {
|
if (count($RL) > 0) {
|
||||||
$m = count($RL);
|
$m = count($RL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -237,7 +237,7 @@ class Matrix
|
||||||
break;
|
break;
|
||||||
//A($i0...$iF); $CL = array of column indices
|
//A($i0...$iF); $CL = array of column indices
|
||||||
case 'integer,integer,array':
|
case 'integer,integer,array':
|
||||||
[$i0, $iF, $CL] = $args;
|
list($i0, $iF, $CL) = $args;
|
||||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
||||||
$m = $iF - $i0;
|
$m = $iF - $i0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -259,7 +259,7 @@ class Matrix
|
||||||
break;
|
break;
|
||||||
//$RL = array of row indices
|
//$RL = array of row indices
|
||||||
case 'array,integer,integer':
|
case 'array,integer,integer':
|
||||||
[$RL, $j0, $jF] = $args;
|
list($RL, $j0, $jF) = $args;
|
||||||
if (count($RL) > 0) {
|
if (count($RL) > 0) {
|
||||||
$m = count($RL);
|
$m = count($RL);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -245,7 +245,7 @@ class OLE
|
||||||
*/
|
*/
|
||||||
private static function _readInt1($fh)
|
private static function _readInt1($fh)
|
||||||
{
|
{
|
||||||
[, $tmp] = unpack('c', fread($fh, 1));
|
list(, $tmp) = unpack('c', fread($fh, 1));
|
||||||
|
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ class OLE
|
||||||
*/
|
*/
|
||||||
private static function _readInt2($fh)
|
private static function _readInt2($fh)
|
||||||
{
|
{
|
||||||
[, $tmp] = unpack('v', fread($fh, 2));
|
list(, $tmp) = unpack('v', fread($fh, 2));
|
||||||
|
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ class OLE
|
||||||
*/
|
*/
|
||||||
private static function _readInt4($fh)
|
private static function _readInt4($fh)
|
||||||
{
|
{
|
||||||
[, $tmp] = unpack('V', fread($fh, 4));
|
list(, $tmp) = unpack('V', fread($fh, 4));
|
||||||
|
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
@ -546,8 +546,8 @@ class OLE
|
||||||
|
|
||||||
// factor used for separating numbers into 4 bytes parts
|
// factor used for separating numbers into 4 bytes parts
|
||||||
$factor = pow(2, 32);
|
$factor = pow(2, 32);
|
||||||
[, $high_part] = unpack('V', substr($string, 4, 4));
|
list(, $high_part) = unpack('V', substr($string, 4, 4));
|
||||||
[, $low_part] = unpack('V', substr($string, 0, 4));
|
list(, $low_part) = unpack('V', substr($string, 0, 4));
|
||||||
|
|
||||||
$big_date = ($high_part * $factor) + $low_part;
|
$big_date = ($high_part * $factor) + $low_part;
|
||||||
// translate to seconds
|
// translate to seconds
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Root extends PPS
|
||||||
$aList = [];
|
$aList = [];
|
||||||
PPS::_savePpsSetPnt($aList, [$this]);
|
PPS::_savePpsSetPnt($aList, [$this]);
|
||||||
// calculate values for header
|
// calculate values for header
|
||||||
[$iSBDcnt, $iBBcnt, $iPPScnt] = $this->_calcSize($aList); //, $rhInfo);
|
list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo);
|
||||||
// Save Header
|
// Save Header
|
||||||
$this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt);
|
$this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt);
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ class Root extends PPS
|
||||||
public function _calcSize(&$raList)
|
public function _calcSize(&$raList)
|
||||||
{
|
{
|
||||||
// Calculate Basic Setting
|
// Calculate Basic Setting
|
||||||
[$iSBDcnt, $iBBcnt, $iPPScnt] = [0, 0, 0];
|
list($iSBDcnt, $iBBcnt, $iPPScnt) = [0, 0, 0];
|
||||||
$iSmallLen = 0;
|
$iSmallLen = 0;
|
||||||
$iSBcnt = 0;
|
$iSBcnt = 0;
|
||||||
$iCount = count($raList);
|
$iCount = count($raList);
|
||||||
|
|
|
@ -211,7 +211,7 @@ class Xls
|
||||||
*/
|
*/
|
||||||
public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height)
|
public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height)
|
||||||
{
|
{
|
||||||
[$column, $row] = Cell::coordinateFromString($coordinates);
|
list($column, $row) = Cell::coordinateFromString($coordinates);
|
||||||
$col_start = Cell::columnIndexFromString($column) - 1;
|
$col_start = Cell::columnIndexFromString($column) - 1;
|
||||||
$row_start = $row - 1;
|
$row_start = $row - 1;
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ class Style extends Style\Supervisor implements IComparable
|
||||||
$rangeA = $pRange;
|
$rangeA = $pRange;
|
||||||
$rangeB = $pRange;
|
$rangeB = $pRange;
|
||||||
} else {
|
} else {
|
||||||
[$rangeA, $rangeB] = explode(':', $pRange);
|
list($rangeA, $rangeB) = explode(':', $pRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
|
|
|
@ -724,7 +724,7 @@ class NumberFormat extends Supervisor implements IComparable
|
||||||
// Currency or Accounting
|
// Currency or Accounting
|
||||||
$currencyFormat = $m[0];
|
$currencyFormat = $m[0];
|
||||||
$currencyCode = $m[1];
|
$currencyCode = $m[1];
|
||||||
[$currencyCode] = explode('-', $currencyCode);
|
list($currencyCode) = explode('-', $currencyCode);
|
||||||
if ($currencyCode == '') {
|
if ($currencyCode == '') {
|
||||||
$currencyCode = StringHelper::getCurrencyCode();
|
$currencyCode = StringHelper::getCurrencyCode();
|
||||||
}
|
}
|
||||||
|
@ -738,7 +738,7 @@ class NumberFormat extends Supervisor implements IComparable
|
||||||
|
|
||||||
// Additional formatting provided by callback function
|
// Additional formatting provided by callback function
|
||||||
if ($callBack !== null) {
|
if ($callBack !== null) {
|
||||||
[$writerInstance, $function] = $callBack;
|
list($writerInstance, $function) = $callBack;
|
||||||
$value = $writerInstance->$function($value, $formatColor);
|
$value = $writerInstance->$function($value, $formatColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1543,7 +1543,7 @@ class Worksheet implements IComparable
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($pRange . ':' . $pRange);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange . ':' . $pRange);
|
||||||
|
|
||||||
// Make sure we can loop upwards on rows and columns
|
// Make sure we can loop upwards on rows and columns
|
||||||
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
|
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
|
||||||
|
@ -1583,7 +1583,7 @@ class Worksheet implements IComparable
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($pRange . ':' . $pRange);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange . ':' . $pRange);
|
||||||
|
|
||||||
// Make sure we can loop upwards on rows and columns
|
// Make sure we can loop upwards on rows and columns
|
||||||
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
|
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
|
||||||
|
@ -2401,7 +2401,7 @@ class Worksheet implements IComparable
|
||||||
$pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);
|
$pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);
|
||||||
|
|
||||||
if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
|
if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
|
||||||
[$first] = Cell::splitRange($pCoordinate);
|
list($first) = Cell::splitRange($pCoordinate);
|
||||||
$this->activeCell = $first[0];
|
$this->activeCell = $first[0];
|
||||||
} else {
|
} else {
|
||||||
$this->activeCell = $pCoordinate;
|
$this->activeCell = $pCoordinate;
|
||||||
|
@ -2470,7 +2470,7 @@ class Worksheet implements IComparable
|
||||||
}
|
}
|
||||||
|
|
||||||
// start coordinate
|
// start coordinate
|
||||||
[$startColumn, $startRow] = Cell::coordinateFromString($startCell);
|
list($startColumn, $startRow) = Cell::coordinateFromString($startCell);
|
||||||
|
|
||||||
// Loop through $source
|
// Loop through $source
|
||||||
foreach ($source as $rowData) {
|
foreach ($source as $rowData) {
|
||||||
|
@ -2512,7 +2512,7 @@ class Worksheet implements IComparable
|
||||||
// Returnvalue
|
// Returnvalue
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
// Identify the range that we need to extract from the worksheet
|
// Identify the range that we need to extract from the worksheet
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($pRange);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange);
|
||||||
$minCol = Cell::stringFromColumnIndex($rangeStart[0] - 1);
|
$minCol = Cell::stringFromColumnIndex($rangeStart[0] - 1);
|
||||||
$minRow = $rangeStart[1];
|
$minRow = $rangeStart[1];
|
||||||
$maxCol = Cell::stringFromColumnIndex($rangeEnd[0] - 1);
|
$maxCol = Cell::stringFromColumnIndex($rangeEnd[0] - 1);
|
||||||
|
|
|
@ -93,7 +93,7 @@ class AutoFilter
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$cellAddress = explode('!', strtoupper($pRange));
|
$cellAddress = explode('!', strtoupper($pRange));
|
||||||
if (count($cellAddress) > 1) {
|
if (count($cellAddress) > 1) {
|
||||||
[$worksheet, $pRange] = $cellAddress;
|
list($worksheet, $pRange) = $cellAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($pRange, ':') !== false) {
|
if (strpos($pRange, ':') !== false) {
|
||||||
|
@ -109,7 +109,7 @@ class AutoFilter
|
||||||
$this->columns = [];
|
$this->columns = [];
|
||||||
} else {
|
} else {
|
||||||
// Discard any column rules that are no longer valid within this range
|
// Discard any column rules that are no longer valid within this range
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($this->range);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($this->range);
|
||||||
foreach ($this->columns as $key => $value) {
|
foreach ($this->columns as $key => $value) {
|
||||||
$colIndex = Cell::columnIndexFromString($key);
|
$colIndex = Cell::columnIndexFromString($key);
|
||||||
if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
|
if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
|
||||||
|
@ -149,7 +149,7 @@ class AutoFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
$columnIndex = Cell::columnIndexFromString($column);
|
$columnIndex = Cell::columnIndexFromString($column);
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($this->range);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($this->range);
|
||||||
if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
|
if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
|
||||||
throw new PhpSpreadsheetException('Column is outside of current autofilter range.');
|
throw new PhpSpreadsheetException('Column is outside of current autofilter range.');
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ class AutoFilter
|
||||||
*/
|
*/
|
||||||
public function getColumnByOffset($pColumnOffset)
|
public function getColumnByOffset($pColumnOffset)
|
||||||
{
|
{
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($this->range);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($this->range);
|
||||||
$pColumn = Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
$pColumn = Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
||||||
|
|
||||||
return $this->getColumn($pColumn);
|
return $this->getColumn($pColumn);
|
||||||
|
@ -624,7 +624,7 @@ class AutoFilter
|
||||||
*/
|
*/
|
||||||
public function showHideRows()
|
public function showHideRows()
|
||||||
{
|
{
|
||||||
[$rangeStart, $rangeEnd] = Cell::rangeBoundaries($this->range);
|
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($this->range);
|
||||||
|
|
||||||
// The heading row should always be visible
|
// The heading row should always be visible
|
||||||
$this->workSheet->getRowDimension($rangeStart[1])->setVisible(true);
|
$this->workSheet->getRowDimension($rangeStart[1])->setVisible(true);
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Drawing extends BaseDrawing implements IComparable
|
||||||
|
|
||||||
if ($this->width == 0 && $this->height == 0) {
|
if ($this->width == 0 && $this->height == 0) {
|
||||||
// Get width/height
|
// Get width/height
|
||||||
[$this->width, $this->height] = getimagesize($pValue);
|
list($this->width, $this->height) = getimagesize($pValue);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new PhpSpreadsheetException("File $pValue not found!");
|
throw new PhpSpreadsheetException("File $pValue not found!");
|
||||||
|
|
|
@ -311,7 +311,7 @@ class HeaderFooterDrawing extends Drawing implements IComparable
|
||||||
|
|
||||||
if ($this->width == 0 && $this->height == 0) {
|
if ($this->width == 0 && $this->height == 0) {
|
||||||
// Get width/height
|
// Get width/height
|
||||||
[$this->width, $this->height] = getimagesize($pValue);
|
list($this->width, $this->height) = getimagesize($pValue);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new PhpSpreadsheetException("File $pValue not found!");
|
throw new PhpSpreadsheetException("File $pValue not found!");
|
||||||
|
|
|
@ -1548,14 +1548,14 @@ class Html extends BaseWriter implements IWriter
|
||||||
|
|
||||||
// loop through all Excel merged cells
|
// loop through all Excel merged cells
|
||||||
foreach ($sheet->getMergeCells() as $cells) {
|
foreach ($sheet->getMergeCells() as $cells) {
|
||||||
[$cells] = Cell::splitRange($cells);
|
list($cells) = Cell::splitRange($cells);
|
||||||
$first = $cells[0];
|
$first = $cells[0];
|
||||||
$last = $cells[1];
|
$last = $cells[1];
|
||||||
|
|
||||||
[$fc, $fr] = Cell::coordinateFromString($first);
|
list($fc, $fr) = Cell::coordinateFromString($first);
|
||||||
$fc = Cell::columnIndexFromString($fc) - 1;
|
$fc = Cell::columnIndexFromString($fc) - 1;
|
||||||
|
|
||||||
[$lc, $lr] = Cell::coordinateFromString($last);
|
list($lc, $lr) = Cell::coordinateFromString($last);
|
||||||
$lc = Cell::columnIndexFromString($lc) - 1;
|
$lc = Cell::columnIndexFromString($lc) - 1;
|
||||||
|
|
||||||
// loop through the individual cells in the individual merge
|
// loop through the individual cells in the individual merge
|
||||||
|
|
|
@ -448,7 +448,7 @@ class Xls extends BaseWriter implements IWriter
|
||||||
if ($drawing instanceof Drawing) {
|
if ($drawing instanceof Drawing) {
|
||||||
$filename = $drawing->getPath();
|
$filename = $drawing->getPath();
|
||||||
|
|
||||||
[$imagesx, $imagesy, $imageFormat] = getimagesize($filename);
|
list($imagesx, $imagesy, $imageFormat) = getimagesize($filename);
|
||||||
|
|
||||||
switch ($imageFormat) {
|
switch ($imageFormat) {
|
||||||
case 1: // GIF, not supported by BIFF8, we convert to PNG
|
case 1: // GIF, not supported by BIFF8, we convert to PNG
|
||||||
|
|
|
@ -421,7 +421,7 @@ class Escher
|
||||||
$recType = 0xF010;
|
$recType = 0xF010;
|
||||||
|
|
||||||
// start coordinates
|
// start coordinates
|
||||||
[$column, $row] = Cell::coordinateFromString($this->object->getStartCoordinates());
|
list($column, $row) = Cell::coordinateFromString($this->object->getStartCoordinates());
|
||||||
$c1 = Cell::columnIndexFromString($column) - 1;
|
$c1 = Cell::columnIndexFromString($column) - 1;
|
||||||
$r1 = $row - 1;
|
$r1 = $row - 1;
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ class Escher
|
||||||
$startOffsetY = $this->object->getStartOffsetY();
|
$startOffsetY = $this->object->getStartOffsetY();
|
||||||
|
|
||||||
// end coordinates
|
// end coordinates
|
||||||
[$column, $row] = Cell::coordinateFromString($this->object->getEndCoordinates());
|
list($column, $row) = Cell::coordinateFromString($this->object->getEndCoordinates());
|
||||||
$c2 = Cell::columnIndexFromString($column) - 1;
|
$c2 = Cell::columnIndexFromString($column) - 1;
|
||||||
$r2 = $row - 1;
|
$r2 = $row - 1;
|
||||||
|
|
||||||
|
|
|
@ -603,15 +603,15 @@ class Parser
|
||||||
// TODO: possible class value 0,1,2 check Formula.pm
|
// TODO: possible class value 0,1,2 check Formula.pm
|
||||||
// Split the range into 2 cell refs
|
// Split the range into 2 cell refs
|
||||||
if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) {
|
if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) {
|
||||||
[$cell1, $cell2] = explode(':', $range);
|
list($cell1, $cell2) = explode(':', $range);
|
||||||
} else {
|
} else {
|
||||||
// TODO: use real error codes
|
// TODO: use real error codes
|
||||||
throw new WriterException('Unknown range separator');
|
throw new WriterException('Unknown range separator');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the cell references
|
// Convert the cell references
|
||||||
[$row1, $col1] = $this->cellToPackedRowcol($cell1);
|
list($row1, $col1) = $this->cellToPackedRowcol($cell1);
|
||||||
[$row2, $col2] = $this->cellToPackedRowcol($cell2);
|
list($row2, $col2) = $this->cellToPackedRowcol($cell2);
|
||||||
|
|
||||||
// The ptg value depends on the class of the ptg.
|
// The ptg value depends on the class of the ptg.
|
||||||
if ($class == 0) {
|
if ($class == 0) {
|
||||||
|
@ -639,20 +639,20 @@ class Parser
|
||||||
private function convertRange3d($token)
|
private function convertRange3d($token)
|
||||||
{
|
{
|
||||||
// Split the ref at the ! symbol
|
// Split the ref at the ! symbol
|
||||||
[$ext_ref, $range] = explode('!', $token);
|
list($ext_ref, $range) = explode('!', $token);
|
||||||
|
|
||||||
// Convert the external reference part (different for BIFF8)
|
// Convert the external reference part (different for BIFF8)
|
||||||
$ext_ref = $this->getRefIndex($ext_ref);
|
$ext_ref = $this->getRefIndex($ext_ref);
|
||||||
|
|
||||||
// Split the range into 2 cell refs
|
// Split the range into 2 cell refs
|
||||||
[$cell1, $cell2] = explode(':', $range);
|
list($cell1, $cell2) = explode(':', $range);
|
||||||
|
|
||||||
// Convert the cell references
|
// Convert the cell references
|
||||||
if (preg_match("/^(\\$)?[A-Ia-i]?[A-Za-z](\\$)?(\d+)$/", $cell1)) {
|
if (preg_match("/^(\\$)?[A-Ia-i]?[A-Za-z](\\$)?(\d+)$/", $cell1)) {
|
||||||
[$row1, $col1] = $this->cellToPackedRowcol($cell1);
|
list($row1, $col1) = $this->cellToPackedRowcol($cell1);
|
||||||
[$row2, $col2] = $this->cellToPackedRowcol($cell2);
|
list($row2, $col2) = $this->cellToPackedRowcol($cell2);
|
||||||
} else { // It's a rows range (like 26:27)
|
} else { // It's a rows range (like 26:27)
|
||||||
[$row1, $col1, $row2, $col2] = $this->rangeToPackedRange($cell1 . ':' . $cell2);
|
list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The ptg value depends on the class of the ptg.
|
// The ptg value depends on the class of the ptg.
|
||||||
|
@ -672,7 +672,7 @@ class Parser
|
||||||
{
|
{
|
||||||
// Convert the cell reference
|
// Convert the cell reference
|
||||||
$cell_array = $this->cellToPackedRowcol($cell);
|
$cell_array = $this->cellToPackedRowcol($cell);
|
||||||
[$row, $col] = $cell_array;
|
list($row, $col) = $cell_array;
|
||||||
|
|
||||||
// The ptg value depends on the class of the ptg.
|
// The ptg value depends on the class of the ptg.
|
||||||
$ptgRef = pack('C', $this->ptg['ptgRefA']);
|
$ptgRef = pack('C', $this->ptg['ptgRefA']);
|
||||||
|
@ -691,13 +691,13 @@ class Parser
|
||||||
private function convertRef3d($cell)
|
private function convertRef3d($cell)
|
||||||
{
|
{
|
||||||
// Split the ref at the ! symbol
|
// Split the ref at the ! symbol
|
||||||
[$ext_ref, $cell] = explode('!', $cell);
|
list($ext_ref, $cell) = explode('!', $cell);
|
||||||
|
|
||||||
// Convert the external reference part (different for BIFF8)
|
// Convert the external reference part (different for BIFF8)
|
||||||
$ext_ref = $this->getRefIndex($ext_ref);
|
$ext_ref = $this->getRefIndex($ext_ref);
|
||||||
|
|
||||||
// Convert the cell reference part
|
// Convert the cell reference part
|
||||||
[$row, $col] = $this->cellToPackedRowcol($cell);
|
list($row, $col) = $this->cellToPackedRowcol($cell);
|
||||||
|
|
||||||
// The ptg value depends on the class of the ptg.
|
// The ptg value depends on the class of the ptg.
|
||||||
$ptgRef = pack('C', $this->ptg['ptgRef3dA']);
|
$ptgRef = pack('C', $this->ptg['ptgRef3dA']);
|
||||||
|
@ -749,7 +749,7 @@ class Parser
|
||||||
|
|
||||||
// Check if there is a sheet range eg., Sheet1:Sheet2.
|
// Check if there is a sheet range eg., Sheet1:Sheet2.
|
||||||
if (preg_match('/:/', $ext_ref)) {
|
if (preg_match('/:/', $ext_ref)) {
|
||||||
[$sheet_name1, $sheet_name2] = explode(':', $ext_ref);
|
list($sheet_name1, $sheet_name2) = explode(':', $ext_ref);
|
||||||
|
|
||||||
$sheet1 = $this->getSheetIndex($sheet_name1);
|
$sheet1 = $this->getSheetIndex($sheet_name1);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
|
@ -762,7 +762,7 @@ class Parser
|
||||||
|
|
||||||
// Reverse max and min sheet numbers if necessary
|
// Reverse max and min sheet numbers if necessary
|
||||||
if ($sheet1 > $sheet2) {
|
if ($sheet1 > $sheet2) {
|
||||||
[$sheet1, $sheet2] = [$sheet2, $sheet1];
|
list($sheet1, $sheet2) = [$sheet2, $sheet1];
|
||||||
}
|
}
|
||||||
} else { // Single sheet name only.
|
} else { // Single sheet name only.
|
||||||
$sheet1 = $this->getSheetIndex($ext_ref);
|
$sheet1 = $this->getSheetIndex($ext_ref);
|
||||||
|
@ -795,7 +795,7 @@ class Parser
|
||||||
|
|
||||||
// Check if there is a sheet range eg., Sheet1:Sheet2.
|
// Check if there is a sheet range eg., Sheet1:Sheet2.
|
||||||
if (preg_match('/:/', $ext_ref)) {
|
if (preg_match('/:/', $ext_ref)) {
|
||||||
[$sheet_name1, $sheet_name2] = explode(':', $ext_ref);
|
list($sheet_name1, $sheet_name2) = explode(':', $ext_ref);
|
||||||
|
|
||||||
$sheet1 = $this->getSheetIndex($sheet_name1);
|
$sheet1 = $this->getSheetIndex($sheet_name1);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
|
@ -808,7 +808,7 @@ class Parser
|
||||||
|
|
||||||
// Reverse max and min sheet numbers if necessary
|
// Reverse max and min sheet numbers if necessary
|
||||||
if ($sheet1 > $sheet2) {
|
if ($sheet1 > $sheet2) {
|
||||||
[$sheet1, $sheet2] = [$sheet2, $sheet1];
|
list($sheet1, $sheet2) = [$sheet2, $sheet1];
|
||||||
}
|
}
|
||||||
} else { // Single sheet name only.
|
} else { // Single sheet name only.
|
||||||
$sheet1 = $this->getSheetIndex($ext_ref);
|
$sheet1 = $this->getSheetIndex($ext_ref);
|
||||||
|
@ -882,7 +882,7 @@ class Parser
|
||||||
private function cellToPackedRowcol($cell)
|
private function cellToPackedRowcol($cell)
|
||||||
{
|
{
|
||||||
$cell = strtoupper($cell);
|
$cell = strtoupper($cell);
|
||||||
[$row, $col, $row_rel, $col_rel] = $this->cellToRowcol($cell);
|
list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell);
|
||||||
if ($col >= 256) {
|
if ($col >= 256) {
|
||||||
throw new WriterException("Column in: $cell greater than 255");
|
throw new WriterException("Column in: $cell greater than 255");
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,7 +478,7 @@ class Worksheet extends BIFFwriter
|
||||||
|
|
||||||
// Hyperlinks
|
// Hyperlinks
|
||||||
foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) {
|
foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) {
|
||||||
[$column, $row] = Cell::coordinateFromString($coordinate);
|
list($column, $row) = Cell::coordinateFromString($coordinate);
|
||||||
|
|
||||||
$url = $hyperlink->getUrl();
|
$url = $hyperlink->getUrl();
|
||||||
|
|
||||||
|
@ -1423,17 +1423,17 @@ class Worksheet extends BIFFwriter
|
||||||
$selectedCells = Cell::splitRange($this->phpSheet->getSelectedCells());
|
$selectedCells = Cell::splitRange($this->phpSheet->getSelectedCells());
|
||||||
$selectedCells = $selectedCells[0];
|
$selectedCells = $selectedCells[0];
|
||||||
if (count($selectedCells) == 2) {
|
if (count($selectedCells) == 2) {
|
||||||
[$first, $last] = $selectedCells;
|
list($first, $last) = $selectedCells;
|
||||||
} else {
|
} else {
|
||||||
$first = $selectedCells[0];
|
$first = $selectedCells[0];
|
||||||
$last = $selectedCells[0];
|
$last = $selectedCells[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
[$colFirst, $rwFirst] = Cell::coordinateFromString($first);
|
list($colFirst, $rwFirst) = Cell::coordinateFromString($first);
|
||||||
$colFirst = Cell::columnIndexFromString($colFirst) - 1; // base 0 column index
|
$colFirst = Cell::columnIndexFromString($colFirst) - 1; // base 0 column index
|
||||||
--$rwFirst; // base 0 row index
|
--$rwFirst; // base 0 row index
|
||||||
|
|
||||||
[$colLast, $rwLast] = Cell::coordinateFromString($last);
|
list($colLast, $rwLast) = Cell::coordinateFromString($last);
|
||||||
$colLast = Cell::columnIndexFromString($colLast) - 1; // base 0 column index
|
$colLast = Cell::columnIndexFromString($colLast) - 1; // base 0 column index
|
||||||
--$rwLast; // base 0 row index
|
--$rwLast; // base 0 row index
|
||||||
|
|
||||||
|
@ -1462,11 +1462,11 @@ class Worksheet extends BIFFwriter
|
||||||
|
|
||||||
// Swap last row/col for first row/col as necessary
|
// Swap last row/col for first row/col as necessary
|
||||||
if ($rwFirst > $rwLast) {
|
if ($rwFirst > $rwLast) {
|
||||||
[$rwFirst, $rwLast] = [$rwLast, $rwFirst];
|
list($rwFirst, $rwLast) = [$rwLast, $rwFirst];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($colFirst > $colLast) {
|
if ($colFirst > $colLast) {
|
||||||
[$colFirst, $colLast] = [$colLast, $colFirst];
|
list($colFirst, $colLast) = [$colLast, $colFirst];
|
||||||
}
|
}
|
||||||
|
|
||||||
$header = pack('vv', $record, $length);
|
$header = pack('vv', $record, $length);
|
||||||
|
@ -1508,9 +1508,9 @@ class Worksheet extends BIFFwriter
|
||||||
|
|
||||||
// extract the row and column indexes
|
// extract the row and column indexes
|
||||||
$range = Cell::splitRange($mergeCell);
|
$range = Cell::splitRange($mergeCell);
|
||||||
[$first, $last] = $range[0];
|
list($first, $last) = $range[0];
|
||||||
[$firstColumn, $firstRow] = Cell::coordinateFromString($first);
|
list($firstColumn, $firstRow) = Cell::coordinateFromString($first);
|
||||||
[$lastColumn, $lastRow] = Cell::coordinateFromString($last);
|
list($lastColumn, $lastRow) = Cell::coordinateFromString($last);
|
||||||
|
|
||||||
$recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, Cell::columnIndexFromString($firstColumn) - 1, Cell::columnIndexFromString($lastColumn) - 1);
|
$recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, Cell::columnIndexFromString($firstColumn) - 1, Cell::columnIndexFromString($lastColumn) - 1);
|
||||||
|
|
||||||
|
@ -1710,7 +1710,7 @@ class Worksheet extends BIFFwriter
|
||||||
{
|
{
|
||||||
$panes = [];
|
$panes = [];
|
||||||
if ($freezePane = $this->phpSheet->getFreezePane()) {
|
if ($freezePane = $this->phpSheet->getFreezePane()) {
|
||||||
[$column, $row] = Cell::coordinateFromString($freezePane);
|
list($column, $row) = Cell::coordinateFromString($freezePane);
|
||||||
$panes[0] = $row - 1;
|
$panes[0] = $row - 1;
|
||||||
$panes[1] = Cell::columnIndexFromString($column) - 1;
|
$panes[1] = Cell::columnIndexFromString($column) - 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2331,7 +2331,7 @@ class Worksheet extends BIFFwriter
|
||||||
public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1)
|
public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1)
|
||||||
{
|
{
|
||||||
$bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap));
|
$bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap));
|
||||||
[$width, $height, $size, $data] = $bitmap_array;
|
list($width, $height, $size, $data) = $bitmap_array;
|
||||||
|
|
||||||
// Scale the frame of the image.
|
// Scale the frame of the image.
|
||||||
$width *= $scale_x;
|
$width *= $scale_x;
|
||||||
|
|
|
@ -177,7 +177,7 @@ class Comments extends WriterPart
|
||||||
private function writeVMLComment(XMLWriter $objWriter, $pCellReference, Comment $pComment)
|
private function writeVMLComment(XMLWriter $objWriter, $pCellReference, Comment $pComment)
|
||||||
{
|
{
|
||||||
// Metadata
|
// Metadata
|
||||||
[$column, $row] = Cell::coordinateFromString($pCellReference);
|
list($column, $row) = Cell::coordinateFromString($pCellReference);
|
||||||
$column = Cell::columnIndexFromString($column);
|
$column = Cell::columnIndexFromString($column);
|
||||||
$id = 1024 + $column + $row;
|
$id = 1024 + $column + $row;
|
||||||
$id = substr($id, 0, 4);
|
$id = substr($id, 0, 4);
|
||||||
|
|
|
@ -352,7 +352,7 @@ class Workbook extends WriterPart
|
||||||
$range = $range[0];
|
$range = $range[0];
|
||||||
// Strip any worksheet ref so we can make the cell ref absolute
|
// Strip any worksheet ref so we can make the cell ref absolute
|
||||||
if (strpos($range[0], '!') !== false) {
|
if (strpos($range[0], '!') !== false) {
|
||||||
[$ws, $range[0]] = explode('!', $range[0]);
|
list($ws, $range[0]) = explode('!', $range[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$range[0] = Cell::absoluteCoordinate($range[0]);
|
$range[0] = Cell::absoluteCoordinate($range[0]);
|
||||||
|
|
|
@ -253,7 +253,7 @@ class Worksheet extends WriterPart
|
||||||
// Calculate freeze coordinates
|
// Calculate freeze coordinates
|
||||||
$xSplit = $ySplit = 0;
|
$xSplit = $ySplit = 0;
|
||||||
|
|
||||||
[$xSplit, $ySplit] = Cell::coordinateFromString($topLeftCell);
|
list($xSplit, $ySplit) = Cell::coordinateFromString($topLeftCell);
|
||||||
$xSplit = Cell::columnIndexFromString($xSplit);
|
$xSplit = Cell::columnIndexFromString($xSplit);
|
||||||
|
|
||||||
// pane
|
// pane
|
||||||
|
@ -761,7 +761,7 @@ class Worksheet extends WriterPart
|
||||||
$range = $range[0];
|
$range = $range[0];
|
||||||
// Strip any worksheet ref
|
// Strip any worksheet ref
|
||||||
if (strpos($range[0], '!') !== false) {
|
if (strpos($range[0], '!') !== false) {
|
||||||
[$ws, $range[0]] = explode('!', $range[0]);
|
list($ws, $range[0]) = explode('!', $range[0]);
|
||||||
}
|
}
|
||||||
$range = implode(':', $range);
|
$range = implode(':', $range);
|
||||||
|
|
||||||
|
|
|
@ -71,10 +71,10 @@ class Complex
|
||||||
if ($imaginaryPart === null) {
|
if ($imaginaryPart === null) {
|
||||||
if (is_array($realPart)) {
|
if (is_array($realPart)) {
|
||||||
// We have an array of (potentially) real and imaginary parts, and any suffix
|
// We have an array of (potentially) real and imaginary parts, and any suffix
|
||||||
[$realPart, $imaginaryPart, $suffix] = array_values($realPart) + [0.0, 0.0, 'i'];
|
list($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i'];
|
||||||
} elseif ((is_string($realPart)) || (is_numeric($realPart))) {
|
} elseif ((is_string($realPart)) || (is_numeric($realPart))) {
|
||||||
// We've been given a string to parse to extract the real and imaginary parts, and any suffix
|
// We've been given a string to parse to extract the real and imaginary parts, and any suffix
|
||||||
[$realPart, $imaginaryPart, $suffix] = self::_parseComplex($realPart);
|
list($realPart, $imaginaryPart, $suffix) = self::_parseComplex($realPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue