Skip to content

Commit 05503db

Browse files
authored
Merge pull request #44 from ChessCom/BP/PHP8.1
Handle Deprecated: Automatic conversion of false to array is deprecated
2 parents ec259cc + 68d9840 commit 05503db

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ php:
66
- "7.3"
77
- "7.4"
88
- "8.0"
9+
- "8.1"
910

1011
matrix:
1112
fast_finish: true

src/Chess/Game/ChessGame.php

+6
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,9 @@ public function moveSAN($move, $from = null)
10501050
$this->moveAlgebraic($this->_KRookColumn . $row, "f$row");
10511051
}
10521052
$this->_moveFromSquare = $this->_KColumn . $row;
1053+
if (!is_array($this->_lastMove)) {
1054+
$this->_lastMove = [];
1055+
}
10531056
$this->_lastMove['square'] = "g$row";
10541057
break;
10551058
case 'Q' :
@@ -1065,6 +1068,9 @@ public function moveSAN($move, $from = null)
10651068
$this->moveAlgebraic($this->_QRookColumn . $row, "d$row");
10661069
}
10671070
$this->_moveFromSquare = $this->_KColumn . $row;
1071+
if (!is_array($this->_lastMove)) {
1072+
$this->_lastMove = [];
1073+
}
10681074
$this->_lastMove['square'] = "c$row";
10691075
break;
10701076
}

0 commit comments

Comments
 (0)