Apply Scrutinzer patches for spacing
This commit is contained in:
parent
c8a69dfb54
commit
e9d03cc6d3
|
@ -67,12 +67,12 @@ echo '<hr />';
|
||||||
<?php
|
<?php
|
||||||
for ($row = 1; $row <= $testDateCount; ++$row) {
|
for ($row = 1; $row <= $testDateCount; ++$row) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td>' , $worksheet->getCell('A' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('A' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('C' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('C' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('D' . $row)->getValue() , '</td>';
|
echo '<td>', $worksheet->getCell('D' . $row)->getValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('D' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('D' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('E' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('E' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -62,10 +62,10 @@ echo '<hr />';
|
||||||
<?php
|
<?php
|
||||||
for ($row = 1; $row <= $testDateCount; ++$row) {
|
for ($row = 1; $row <= $testDateCount; ++$row) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td>' , $worksheet->getCell('A' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('A' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('C' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('C' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -65,12 +65,12 @@ echo '<hr />';
|
||||||
<?php
|
<?php
|
||||||
for ($row = 1; $row <= $testDateCount; ++$row) {
|
for ($row = 1; $row <= $testDateCount; ++$row) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td>' , $worksheet->getCell('A' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('A' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('C' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('C' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('D' . $row)->getValue() , '</td>';
|
echo '<td>', $worksheet->getCell('D' . $row)->getValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('D' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('D' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('E' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('E' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -58,10 +58,10 @@ echo '<hr />';
|
||||||
<?php
|
<?php
|
||||||
for ($row = 1; $row <= $testDateCount; ++$row) {
|
for ($row = 1; $row <= $testDateCount; ++$row) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td>' , $worksheet->getCell('A' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('A' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('B' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('B' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '<td>' , $worksheet->getCell('C' . $row)->getFormattedValue() , '</td>';
|
echo '<td>', $worksheet->getCell('C' . $row)->getFormattedValue(), '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -40,10 +40,10 @@ $spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />';
|
echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />';
|
||||||
$loadedSheetNames = $spreadsheet->getSheetNames();
|
$loadedSheetNames = $spreadsheet->getSheetNames();
|
||||||
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo $sheetIndex,' -> ',$loadedSheetName,'<br />';
|
echo $sheetIndex, ' -> ', $loadedSheetName, '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -39,7 +39,7 @@ class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter
|
||||||
|
|
||||||
private $_endRow = 0;
|
private $_endRow = 0;
|
||||||
|
|
||||||
/** Set the list of rows that we want to read */
|
/** Set the list of rows that we want to read */
|
||||||
public function setRows($startRow, $chunkSize)
|
public function setRows($startRow, $chunkSize)
|
||||||
{
|
{
|
||||||
$this->_startRow = $startRow;
|
$this->_startRow = $startRow;
|
||||||
|
@ -73,7 +73,7 @@ $reader->setReadFilter($chunkFilter);
|
||||||
|
|
||||||
/* Loop to read our worksheet in "chunk size" blocks **/
|
/* Loop to read our worksheet in "chunk size" blocks **/
|
||||||
for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />';
|
echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />';
|
||||||
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
||||||
$chunkFilter->setRows($startRow, $chunkSize);
|
$chunkFilter->setRows($startRow, $chunkSize);
|
||||||
/* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/
|
/* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/
|
||||||
|
|
|
@ -42,10 +42,10 @@ foreach ($inputFileNames as $sheet => $inputFileName) {
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />';
|
echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />';
|
||||||
$loadedSheetNames = $spreadsheet->getSheetNames();
|
$loadedSheetNames = $spreadsheet->getSheetNames();
|
||||||
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />';
|
echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />';
|
||||||
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
||||||
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
|
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
|
||||||
var_dump($sheetData);
|
var_dump($sheetData);
|
||||||
|
|
|
@ -30,7 +30,7 @@ class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter
|
||||||
|
|
||||||
private $_endRow = 0;
|
private $_endRow = 0;
|
||||||
|
|
||||||
/** Set the list of rows that we want to read */
|
/** Set the list of rows that we want to read */
|
||||||
public function setRows($startRow, $chunkSize)
|
public function setRows($startRow, $chunkSize)
|
||||||
{
|
{
|
||||||
$this->_startRow = $startRow;
|
$this->_startRow = $startRow;
|
||||||
|
@ -72,7 +72,7 @@ $sheet = 0;
|
||||||
/* Loop to read our worksheet in "chunk size" blocks **/
|
/* Loop to read our worksheet in "chunk size" blocks **/
|
||||||
/** $startRow is set to 2 initially because we always read the headings in row #1 **/
|
/** $startRow is set to 2 initially because we always read the headings in row #1 **/
|
||||||
for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
echo 'Loading WorkSheet #',($sheet + 1),' using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />';
|
echo 'Loading WorkSheet #', ($sheet + 1), ' using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />';
|
||||||
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
||||||
$chunkFilter->setRows($startRow, $chunkSize);
|
$chunkFilter->setRows($startRow, $chunkSize);
|
||||||
|
|
||||||
|
@ -87,10 +87,10 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />';
|
echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />';
|
||||||
$loadedSheetNames = $spreadsheet->getSheetNames();
|
$loadedSheetNames = $spreadsheet->getSheetNames();
|
||||||
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />';
|
echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />';
|
||||||
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
||||||
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true);
|
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true);
|
||||||
var_dump($sheetData);
|
var_dump($sheetData);
|
||||||
|
|
|
@ -46,7 +46,7 @@ foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Unformatted)</b><br />';
|
echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Unformatted)</b><br />';
|
||||||
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
||||||
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, false, true);
|
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, false, true);
|
||||||
var_dump($sheetData);
|
var_dump($sheetData);
|
||||||
|
@ -56,7 +56,7 @@ foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
|
||||||
echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Raw)</b><br />';
|
echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Raw)</b><br />';
|
||||||
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
$spreadsheet->setActiveSheetIndexByName($loadedSheetName);
|
||||||
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true);
|
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true);
|
||||||
var_dump($sheetData);
|
var_dump($sheetData);
|
||||||
|
|
|
@ -40,7 +40,7 @@ $customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
|
||||||
|
|
||||||
echo '<b>Custom Property names: </b><br />';
|
echo '<b>Custom Property names: </b><br />';
|
||||||
foreach ($customPropertyList as $customPropertyName) {
|
foreach ($customPropertyList as $customPropertyName) {
|
||||||
echo $customPropertyName,'<br />';
|
echo $customPropertyName, '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -49,26 +49,26 @@ foreach ($customPropertyList as $customPropertyName) {
|
||||||
|
|
||||||
/* Manipulate properties as appropriate for display purposes **/
|
/* Manipulate properties as appropriate for display purposes **/
|
||||||
switch ($propertyType) {
|
switch ($propertyType) {
|
||||||
case 'i' : // integer
|
case 'i': // integer
|
||||||
$propertyType = 'integer number';
|
$propertyType = 'integer number';
|
||||||
break;
|
break;
|
||||||
case 'f' : // float
|
case 'f': // float
|
||||||
$propertyType = 'floating point number';
|
$propertyType = 'floating point number';
|
||||||
break;
|
break;
|
||||||
case 's' : // string
|
case 's': // string
|
||||||
$propertyType = 'string';
|
$propertyType = 'string';
|
||||||
break;
|
break;
|
||||||
case 'd' : // date
|
case 'd': // date
|
||||||
$propertyValue = date('l, d<\s\up>S</\s\up> F Y g:i A', $propertyValue);
|
$propertyValue = date('l, d<\s\up>S</\s\up> F Y g:i A', $propertyValue);
|
||||||
$propertyType = 'date';
|
$propertyType = 'date';
|
||||||
break;
|
break;
|
||||||
case 'b' : // boolean
|
case 'b': // boolean
|
||||||
$propertyValue = ($propertyValue) ? 'TRUE' : 'FALSE';
|
$propertyValue = ($propertyValue) ? 'TRUE' : 'FALSE';
|
||||||
$propertyType = 'boolean';
|
$propertyType = 'boolean';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $propertyValue,' (',$propertyType,')<br />';
|
echo $propertyValue, ' (', $propertyType, ')<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -34,10 +34,10 @@ foreach ($exampleTypeList as $exampleType) {
|
||||||
$h1Text = $out[1];
|
$h1Text = $out[1];
|
||||||
$h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : '';
|
$h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : '';
|
||||||
|
|
||||||
echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />';
|
echo '<a href="', $exampleFile, '">', $h1Text, '</a><br />';
|
||||||
if (($h2Text > '') &&
|
if (($h2Text > '') &&
|
||||||
(pathinfo($exampleType, PATHINFO_BASENAME) != 'Calculations')) {
|
(pathinfo($exampleType, PATHINFO_BASENAME) != 'Calculations')) {
|
||||||
echo $h2Text,'<br />';
|
echo $h2Text, '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ $spreadsheet->getActiveSheet()->getCell('A18')->setValue($richText);
|
||||||
// Merge cells
|
// Merge cells
|
||||||
$helper->log('Merge cells');
|
$helper->log('Merge cells');
|
||||||
$spreadsheet->getActiveSheet()->mergeCells('A18:E22');
|
$spreadsheet->getActiveSheet()->mergeCells('A18:E22');
|
||||||
$spreadsheet->getActiveSheet()->mergeCells('A28:B28'); // Just to test...
|
$spreadsheet->getActiveSheet()->mergeCells('A28:B28'); // Just to test...
|
||||||
$spreadsheet->getActiveSheet()->unmergeCells('A28:B28'); // Just to test...
|
$spreadsheet->getActiveSheet()->unmergeCells('A28:B28'); // Just to test...
|
||||||
// Protect cells
|
// Protect cells
|
||||||
$helper->log('Protect cells');
|
$helper->log('Protect cells');
|
||||||
|
|
|
@ -3118,7 +3118,7 @@ class Calculation
|
||||||
// The guts of the lexical parser
|
// The guts of the lexical parser
|
||||||
// Loop through the formula extracting each operator and operand in turn
|
// Loop through the formula extracting each operator and operand in turn
|
||||||
while (true) {
|
while (true) {
|
||||||
$opCharacter = $formula[$index]; // Get the first character of the value at the current index position
|
$opCharacter = $formula[$index]; // Get the first character of the value at the current index position
|
||||||
if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula[$index + 1]]))) {
|
if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula[$index + 1]]))) {
|
||||||
$opCharacter .= $formula[++$index];
|
$opCharacter .= $formula[++$index];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue