Skip to content

Commit b711923

Browse files
committed
2 parents e0f5824 + 83a5053 commit b711923

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+663
-168
lines changed

.travis.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
language: php
2-
dist: trusty
2+
dist: bionic
33

44
php:
55
- 7.1
66
- 7.2
77
- 7.3
8-
- 7.4snapshot
9-
10-
matrix:
11-
fast_finish: true
12-
allow_failures:
13-
- php: 7.4snapshot
8+
- 7.4
149

1510
cache:
1611
directories:
@@ -20,7 +15,7 @@ cache:
2015

2116
before_script:
2217
# Deactivate xdebug
23-
- if [ -z "$KEEP_XDEBUG" ]; then rm -rfv /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ; fi
18+
- phpenv config-rm xdebug.ini
2419
- composer install --ignore-platform-reqs
2520

2621
script:
@@ -37,9 +32,11 @@ jobs:
3732

3833
- stage: Coverage
3934
php: 7.2
40-
env: KEEP_XDEBUG=1
4135
script:
42-
- travis_wait 40 ./vendor/bin/phpunit --debug --coverage-clover coverage-clover.xml
36+
- pecl install pcov
37+
- composer require pcov/clobber --dev
38+
- ./vendor/bin/pcov clobber
39+
- ./vendor/bin/phpunit --coverage-clover coverage-clover.xml
4340
after_script:
4441
- wget https://scrutinizer-ci.com/ocular.phar
4542
- php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8+
## [Unreleased]
9+
10+
- Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278)
11+
- Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267)
12+
- Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296)
13+
- Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282)
14+
15+
## [1.10.1] - 2019-12-02
16+
17+
### Changed
18+
19+
- PHP 7.4 compatibility
20+
21+
### Fixed
22+
23+
- FLOOR() function accept negative number and negative significance [#1245](https://github.com/PHPOffice/PhpSpreadsheet/pull/1245)
24+
- Correct column style even when using rowspan [#1249](https://github.com/PHPOffice/PhpSpreadsheet/pull/1249)
25+
- Do not confuse defined names and cell refs [#1263](https://github.com/PHPOffice/PhpSpreadsheet/pull/1263)
26+
- XLSX reader/writer keep decimal for floats with a zero decimal part [#1262](https://github.com/PHPOffice/PhpSpreadsheet/pull/1262)
27+
- ODS writer prevent invalid numeric value if locale decimal separator is comma [#1268](https://github.com/PHPOffice/PhpSpreadsheet/pull/1268)
28+
- Xlsx writer actually writes plotVisOnly and dispBlanksAs from chart properties [#1266](https://github.com/PHPOffice/PhpSpreadsheet/pull/1266)
29+
830
## [1.10.0] - 2019-11-18
931

1032
### Changed

composer.lock

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpSpreadsheet/Calculation/Calculation.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Calculation
2525
// Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it)
2626
const CALCULATION_REGEXP_FUNCTION = '@?(?:_xlfn\.)?([A-Z][A-Z0-9\.]*)[\s]*\(';
2727
// Cell reference (cell or range of cells, with or without a sheet reference)
28-
const CALCULATION_REGEXP_CELLREF = '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})';
28+
const CALCULATION_REGEXP_CELLREF = '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?\b([a-z]{1,3})\$?(\d{1,7})(?![\w.])';
2929
// Named Range of cells
3030
const CALCULATION_REGEXP_NAMEDRANGE = '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)';
3131
// Error
@@ -2864,13 +2864,13 @@ public function calculateFormula($formula, $cellID = null, Cell $pCell = null)
28642864
$this->debugLog->clearLog();
28652865
$this->cyclicReferenceStack->clear();
28662866

2867+
$resetCache = $this->getCalculationCacheEnabled();
28672868
if ($this->spreadsheet !== null && $cellID === null && $pCell === null) {
28682869
$cellID = 'A1';
28692870
$pCell = $this->spreadsheet->getActiveSheet()->getCell($cellID);
28702871
} else {
28712872
// Disable calculation cacheing because it only applies to cell calculations, not straight formulae
28722873
// But don't actually flush any cache
2873-
$resetCache = $this->getCalculationCacheEnabled();
28742874
$this->calculationCacheEnabled = false;
28752875
}
28762876

@@ -3239,7 +3239,7 @@ private function showTypeDetails($value)
32393239
/**
32403240
* @param string $formula
32413241
*
3242-
* @return string
3242+
* @return false|string False indicates an error
32433243
*/
32443244
private function convertMatrixReferences($formula)
32453245
{
@@ -3459,7 +3459,7 @@ private function _parseFormula($formula, Cell $pCell = null)
34593459
$parenthesisDepthMap[$pendingStoreKey] -= 1;
34603460
}
34613461

3462-
if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
3462+
if (is_array($d) && preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
34633463
if (!empty($pendingStoreKey) && $parenthesisDepthMap[$pendingStoreKey] == -1) {
34643464
// we are closing an IF(
34653465
if ($d['value'] != 'IF(') {

src/PhpSpreadsheet/Calculation/DateTime.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ public static function DATEVALUE($dateValue = 1)
491491
$yearFound = true;
492492
}
493493
}
494-
if ((count($t1) == 1) && (strpos($t, ':') != false)) {
494+
if ((count($t1) == 1) && (strpos($t, ':') !== false)) {
495495
// We've been fed a time value without any date
496496
return 0.0;
497497
} elseif (count($t1) == 2) {
@@ -892,7 +892,7 @@ public static function DAYS360($startDate = 0, $endDate = 0, $method = false)
892892
* 3 Actual/365
893893
* 4 European 30/360
894894
*
895-
* @return float fraction of the year
895+
* @return float|string fraction of the year, or a string containing an error
896896
*/
897897
public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0)
898898
{

src/PhpSpreadsheet/Calculation/Engineering.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ private static function nbrConversionFormat($xVal, $places)
785785
* If $ord is nonnumeric, BESSELI returns the #VALUE! error value.
786786
* If $ord < 0, BESSELI returns the #NUM! error value.
787787
*
788-
* @return float
788+
* @return float|string Result, or a string containing an error
789789
*/
790790
public static function BESSELI($x, $ord)
791791
{
@@ -839,7 +839,7 @@ public static function BESSELI($x, $ord)
839839
* If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
840840
* If $ord < 0, BESSELJ returns the #NUM! error value.
841841
*
842-
* @return float
842+
* @return float|string Result, or a string containing an error
843843
*/
844844
public static function BESSELJ($x, $ord)
845845
{
@@ -932,7 +932,7 @@ private static function besselK1($fNum)
932932
* If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
933933
* If $ord < 0, BESSELK returns the #NUM! error value.
934934
*
935-
* @return float
935+
* @return float|string Result, or a string containing an error
936936
*/
937937
public static function BESSELK($x, $ord)
938938
{
@@ -1021,7 +1021,7 @@ private static function besselY1($fNum)
10211021
* If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
10221022
* If $ord < 0, BESSELK returns the #NUM! error value.
10231023
*
1024-
* @return float
1024+
* @return float|string Result, or a string containing an error
10251025
*/
10261026
public static function BESSELY($x, $ord)
10271027
{

0 commit comments

Comments
 (0)