Skip to content

Commit 30d4072

Browse files
authored
PHP 7.2 support (#34)
1 parent e2d8d6c commit 30d4072

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ php:
55
- "7.2"
66

77
matrix:
8-
allow_failures:
9-
- php: "7.2"
108
fast_finish: true
119

1210
before_script:

src/Chess/Game/ChessGame.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,8 @@ public function moveSAN($move, $from = null)
10181018
}
10191019
if (!$this->isError($parsedMove = $this->_parseMove($move))) {
10201020
if (!$this->isError($err = $this->_validMove($parsedMove, $from))) {
1021-
list($key, $parsedMove) = each($parsedMove);
1021+
$key = key($parsedMove);
1022+
$parsedMove = current($parsedMove);
10221023
$this->_moves[$this->_moveNumber][($this->_move == 'W') ? 0 : 1] = $move;
10231024
$oldMoveNumber = $this->_moveNumber;
10241025
$this->_moveNumber += ($this->_move == 'W') ? 0 : 1;
@@ -2305,7 +2306,8 @@ public function _parseFen($fen)
23052306
*/
23062307
public function _validMove($move, $from = null)
23072308
{
2308-
list($type, $info) = each($move);
2309+
$type = key($move);
2310+
$info = current($move);
23092311
23102312
$this->startTransaction();
23112313
$valid = false;

0 commit comments

Comments
 (0)