Support PHP 7.2

This commit is contained in:
Adrien Crivelli 2018-01-28 16:23:38 +09:00
parent c96e2dae02
commit d2f55ffa07
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
4 changed files with 9 additions and 4 deletions

View File

@ -10,10 +10,8 @@ php:
matrix: matrix:
include: include:
- php: 7.0 - php: 7.1
env: COVERAGE=1 env: COVERAGE=1
allow_failures:
- php: 7.2
cache: cache:
directories: directories:

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added ### Added
- Support for PHP 7.2
- Support cell comments in HTML writer and reader - [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308) - Support cell comments in HTML writer and reader - [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308)
- Option to stop at a conditional styling, if it matches (only XLSX format) - [#292](https://github.com/PHPOffice/PhpSpreadsheet/pull/292) - Option to stop at a conditional styling, if it matches (only XLSX format) - [#292](https://github.com/PHPOffice/PhpSpreadsheet/pull/292)
- Support for line width for data series when rendering Xlsx - [#329](https://github.com/PHPOffice/PhpSpreadsheet/pull/329) - Support for line width for data series when rendering Xlsx - [#329](https://github.com/PHPOffice/PhpSpreadsheet/pull/329)

View File

@ -2798,11 +2798,12 @@ class Calculation
$matrixRows = count($matrix); $matrixRows = count($matrix);
$matrixColumns = 0; $matrixColumns = 0;
foreach ($matrix as $rowKey => $rowValue) { foreach ($matrix as $rowKey => $rowValue) {
$matrixColumns = max(count($rowValue), $matrixColumns);
if (!is_array($rowValue)) { if (!is_array($rowValue)) {
$matrix[$rowKey] = [$rowValue]; $matrix[$rowKey] = [$rowValue];
$matrixColumns = max(1, $matrixColumns);
} else { } else {
$matrix[$rowKey] = array_values($rowValue); $matrix[$rowKey] = array_values($rowValue);
$matrixColumns = max(count($rowValue), $matrixColumns);
} }
} }
$matrix = array_values($matrix); $matrix = array_values($matrix);

View File

@ -30,6 +30,11 @@ class SampleTest extends TestCase
'Chart/32_Chart_read_write_HTML.php', // idem 'Chart/32_Chart_read_write_HTML.php', // idem
]; ];
// TCPDF does not support PHP 7.2
if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
$skipped[] = 'Pdf/21_Pdf_TCPDF.php';
}
// Unfortunately some tests are too long be ran with code-coverage // Unfortunately some tests are too long be ran with code-coverage
// analysis on Travis, so we need to exclude them // analysis on Travis, so we need to exclude them
global $argv; global $argv;