Skip to content

Commit

Permalink
Adjust explode result return to be compatible with php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ariskataoka committed Oct 25, 2021
1 parent d61bfad commit 14729f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion skip-file.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,8 @@ function vipgo_get_large_files_from_comment( $comment ): array {
return [];
}

return explode( "\n - ", $comment ) ?: [];
$files = explode( "\n - ", $comment );

// This return is to be compatible with php 8.0
return empty( $files[0] ) ? array() : $files;
}
2 changes: 1 addition & 1 deletion tests/unit/VipgociSkipFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private function getResultsMock(): array {
* @return array
*/
private function getSkippedFilesCommentsMock(): array {
$mock = $this->getSkippedFilesCommentMock();
$mock = $this->getSkippedFilesCommentMock();

return [ $mock ];
}
Expand Down

0 comments on commit 14729f8

Please sign in to comment.