Skip to content

Commit

Permalink
php7.4 curved brackets deprecation (#20)
Browse files Browse the repository at this point in the history
* php7.4 curved brackets deprecation

* travis 7.4 support

* change php 8.0 to 7.5

Co-Authored-By: Alexey Kopytko <[email protected]>
  • Loading branch information
dmitryuk and sanmai committed Dec 13, 2019
1 parent 19c8cce commit 58f64dd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4

cache:
directories:
Expand Down
14 changes: 7 additions & 7 deletions Spreadsheet/Excel/Writer/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ protected function _cellToRowcol($cell)
$col = 0;
$col_ref_length = strlen($col_ref);
for ($i = 0; $i < $col_ref_length; $i++) {
$col += (ord($col_ref{$i}) - ord('A') + 1) * pow(26, $expn);
$col += (ord($col_ref[$i]) - ord('A') + 1) * pow(26, $expn);
$expn--;
}

Expand All @@ -1113,20 +1113,20 @@ protected function _advance()
$formula_length = strlen($this->_formula);
// eat up white spaces
if ($i < $formula_length) {
while ($this->_formula{$i} == " ") {
while ($this->_formula[$i] == " ") {
$i++;
}

if ($i < ($formula_length - 1)) {
$this->_lookahead = $this->_formula{$i+1};
$this->_lookahead = $this->_formula[$i+1];
}
$token = '';
}

while ($i < $formula_length) {
$token .= $this->_formula{$i};
$token .= $this->_formula[$i];
if ($i < ($formula_length - 1)) {
$this->_lookahead = $this->_formula{$i+1};
$this->_lookahead = $this->_formula[$i+1];
} else {
$this->_lookahead = '';
}
Expand All @@ -1141,7 +1141,7 @@ protected function _advance()
}

if ($i < ($formula_length - 2)) {
$this->_lookahead = $this->_formula{$i+2};
$this->_lookahead = $this->_formula[$i+2];
} else { // if we run out of characters _lookahead becomes empty
$this->_lookahead = '';
}
Expand Down Expand Up @@ -1292,7 +1292,7 @@ public function parse($formula)
{
$this->_current_char = 0;
$this->_formula = $formula;
$this->_lookahead = $formula{1};
$this->_lookahead = $formula[1];
$this->_advance();
$this->_parse_tree = $this->_condition();
if (PEAR::isError($this->_parse_tree)) {
Expand Down
1 change: 0 additions & 1 deletion Spreadsheet/Excel/Writer/Workbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,6 @@ protected function _calculateSharedStringsSizes()
they must be written before the SST records
*/

$tmp_block_sizes = array();
$tmp_block_sizes = $this->_block_sizes;

$length = 12;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"require": {
"pear/pear-core-minimal": "^1.10",
"pear/ole": ">=1.0.0RC4",
"php": ">=5.3.3 <7.4"
"php": ">=5.3.3 <7.5"
},
"require-dev": {
"phpunit/phpunit": "<6.0"
Expand Down

0 comments on commit 58f64dd

Please sign in to comment.