Vendor updates
This commit is contained in:
@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [1.4.1] - 2018-09-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Remove locale from formatting string - [#644](https://github.com/PHPOffice/PhpSpreadsheet/pull/644)
|
||||
- Allow iterators to go out of bounds with prev - [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587)
|
||||
- Fix warning when reading xlsx without styles - [#631](https://github.com/PHPOffice/PhpSpreadsheet/pull/631)
|
||||
- Fix broken sample links on windows due to $baseDir having backslash - [#653](https://github.com/PHPOffice/PhpSpreadsheet/pull/653)
|
||||
|
||||
## [1.4.0] - 2018-08-06
|
||||
|
||||
### Added
|
||||
|
@ -61,7 +61,7 @@
|
||||
"suggest": {
|
||||
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
|
||||
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
|
||||
"tecnick.com/tcpdf": "Option for rendering PDF with PDF Writer",
|
||||
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
|
||||
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -43,7 +43,7 @@ usage of PhpSpreadsheet.
|
||||
## Common use cases
|
||||
|
||||
PhpSpreadsheet does not ship with alternative cache implementation. It is up to
|
||||
you to select the most appropriate implementation for your environnement. You
|
||||
you to select the most appropriate implementation for your environment. You
|
||||
can either implement [PSR-16](http://www.php-fig.org/psr/psr-16/) from scratch,
|
||||
or use [pre-existing libraries](https://packagist.org/search/?q=psr-16).
|
||||
|
||||
|
@ -82,7 +82,7 @@ class Sample
|
||||
|
||||
$files = [];
|
||||
foreach ($regex as $file) {
|
||||
$file = str_replace($baseDir . '/', '', $file[0]);
|
||||
$file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0]));
|
||||
$info = pathinfo($file);
|
||||
$category = str_replace('_', ' ', $info['dirname']);
|
||||
$name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
|
||||
|
@ -1127,7 +1127,7 @@ class Xls extends BaseReader
|
||||
// TODO: Why is there no BSE Index? Is this a new Office Version? Password protected field?
|
||||
// More likely : a uncompatible picture
|
||||
if (!$BSEindex) {
|
||||
continue;
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();
|
||||
|
@ -643,7 +643,7 @@ class Xlsx extends BaseReader
|
||||
$excel->addCellXf($objStyle);
|
||||
}
|
||||
|
||||
foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
|
||||
foreach (isset($xmlStyles->cellStyleXfs->xf) ? $xmlStyles->cellStyleXfs->xf : [] as $xf) {
|
||||
$numFmt = NumberFormat::FORMAT_GENERAL;
|
||||
if ($numFmts && $xf['numFmtId']) {
|
||||
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
|
||||
|
@ -320,7 +320,7 @@ class OLE
|
||||
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
fseek($fh, 1, SEEK_CUR);
|
||||
$pps->Type = $type;
|
||||
|
@ -691,6 +691,9 @@ class NumberFormat extends Supervisor
|
||||
// Strip #
|
||||
$format = preg_replace('/\\#/', '0', $format);
|
||||
|
||||
// Remove locale code [$-###]
|
||||
$format = preg_replace('/\[\$\-.*\]/', '', $format);
|
||||
|
||||
$n = '/\\[[^\\]]+\\]/';
|
||||
$m = preg_replace($n, '', $format);
|
||||
$number_regex = '/(0+)(\\.?)(0*)/';
|
||||
|
@ -153,10 +153,6 @@ class ColumnCellIterator extends CellIterator
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->currentRow <= $this->startRow) {
|
||||
throw new PhpSpreadsheetException("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
}
|
||||
|
||||
do {
|
||||
--$this->currentRow;
|
||||
} while (($this->onlyExistingCells) &&
|
||||
@ -171,7 +167,7 @@ class ColumnCellIterator extends CellIterator
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->currentRow <= $this->endRow;
|
||||
return $this->currentRow <= $this->endRow && $this->currentRow >= $this->startRow;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,14 +157,9 @@ class ColumnIterator implements \Iterator
|
||||
|
||||
/**
|
||||
* Set the iterator to its previous value.
|
||||
*
|
||||
* @throws PhpSpreadsheetException
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->currentColumnIndex <= $this->startColumnIndex) {
|
||||
throw new PhpSpreadsheetException('Column is already at the beginning of range (' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ' - ' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ')');
|
||||
}
|
||||
--$this->currentColumnIndex;
|
||||
}
|
||||
|
||||
@ -175,6 +170,6 @@ class ColumnIterator implements \Iterator
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->currentColumnIndex <= $this->endColumnIndex;
|
||||
return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class Iterator implements \Iterator
|
||||
*
|
||||
* @param Spreadsheet $subject
|
||||
*/
|
||||
public function __construct(Spreadsheet $subject = null)
|
||||
public function __construct(Spreadsheet $subject)
|
||||
{
|
||||
// Set subject
|
||||
$this->subject = $subject;
|
||||
@ -82,6 +82,6 @@ class Iterator implements \Iterator
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->position < $this->subject->getSheetCount();
|
||||
return $this->position < $this->subject->getSheetCount() && $this->position >= 0;
|
||||
}
|
||||
}
|
||||
|
@ -155,9 +155,6 @@ class RowCellIterator extends CellIterator
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->currentColumnIndex <= $this->startColumnIndex) {
|
||||
throw new PhpSpreadsheetException('Column is already at the beginning of range (' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ' - ' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ')');
|
||||
}
|
||||
do {
|
||||
--$this->currentColumnIndex;
|
||||
} while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex >= $this->startColumnIndex));
|
||||
@ -170,7 +167,7 @@ class RowCellIterator extends CellIterator
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->currentColumnIndex <= $this->endColumnIndex;
|
||||
return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,15 +152,9 @@ class RowIterator implements \Iterator
|
||||
|
||||
/**
|
||||
* Set the iterator to its previous value.
|
||||
*
|
||||
* @throws PhpSpreadsheetException
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->position <= $this->startRow) {
|
||||
throw new PhpSpreadsheetException("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
}
|
||||
|
||||
--$this->position;
|
||||
}
|
||||
|
||||
@ -171,6 +165,6 @@ class RowIterator implements \Iterator
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->position <= $this->endRow;
|
||||
return $this->position <= $this->endRow && $this->position >= $this->startRow;
|
||||
}
|
||||
}
|
||||
|
@ -78,9 +78,8 @@ class ColumnCellIteratorTest extends TestCase
|
||||
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
|
||||
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator->prev();
|
||||
self::assertFalse($iterator->valid());
|
||||
}
|
||||
}
|
||||
|
@ -77,9 +77,8 @@ class ColumnIteratorTest extends TestCase
|
||||
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
|
||||
|
||||
$iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator->prev();
|
||||
self::assertFalse($iterator->valid());
|
||||
}
|
||||
}
|
||||
|
28
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/IteratorTest.php
vendored
Normal file
28
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/IteratorTest.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Iterator;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class IteratorTest extends TestCase
|
||||
{
|
||||
public function testIteratorFullRange()
|
||||
{
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$spreadsheet->createSheet();
|
||||
$spreadsheet->createSheet();
|
||||
|
||||
$iterator = new Iterator($spreadsheet);
|
||||
$columnIndexResult = 0;
|
||||
self::assertEquals($columnIndexResult, $iterator->key());
|
||||
|
||||
foreach ($iterator as $key => $column) {
|
||||
self::assertEquals($columnIndexResult++, $key);
|
||||
self::assertInstanceOf(Worksheet::class, $column);
|
||||
}
|
||||
self::assertSame(3, $columnIndexResult);
|
||||
}
|
||||
}
|
@ -80,9 +80,8 @@ class RowCellIteratorTest extends TestCase
|
||||
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
|
||||
|
||||
$iterator = new RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
|
||||
$iterator->prev();
|
||||
self::assertFalse($iterator->valid());
|
||||
}
|
||||
}
|
||||
|
@ -75,9 +75,8 @@ class RowIteratorTest extends TestCase
|
||||
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
|
||||
|
||||
$iterator = new RowIterator($this->mockWorksheet, 2, 4);
|
||||
$iterator->prev();
|
||||
self::assertFalse($iterator->valid());
|
||||
}
|
||||
}
|
||||
|
@ -186,4 +186,24 @@ return [
|
||||
-1234567.8899999999,
|
||||
'0000:00.00',
|
||||
],
|
||||
[
|
||||
'18.952',
|
||||
18.952,
|
||||
'[$-409]General',
|
||||
],
|
||||
[
|
||||
'9.98',
|
||||
9.98,
|
||||
'[$-409]#,##0.00;-#,##0.00',
|
||||
],
|
||||
[
|
||||
'18.952',
|
||||
18.952,
|
||||
'[$-1010409]General',
|
||||
],
|
||||
[
|
||||
'9.98',
|
||||
9.98,
|
||||
'[$-1010409]#,##0.00;-#,##0.00',
|
||||
],
|
||||
];
|
||||
|
@ -62,4 +62,14 @@ return [
|
||||
43270.603472222,
|
||||
'hh:mm:ss\ AM/PM',
|
||||
],
|
||||
[
|
||||
'8/20/2018',
|
||||
43332,
|
||||
'[$-409]m/d/yyyy',
|
||||
],
|
||||
[
|
||||
'8/20/2018',
|
||||
43332,
|
||||
'[$-1010409]m/d/yyyy',
|
||||
],
|
||||
];
|
||||
|
Reference in New Issue
Block a user