Skip to content

Commit

Permalink
Don’t run version_compare with null
Browse files Browse the repository at this point in the history
I ran into deprecation warnings where `$tag` was `null` when running these commands in preparation for the 2.9.0 release
  • Loading branch information
swissspidy committed Oct 25, 2023
1 parent 6a909c2 commit 362abcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .maintenance/src/Contrib_List_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public function __invoke( $args, $assoc_args ) {
$milestone = array_reduce(
$milestones,
function ( $tag, $milestone ) {
if ( ! $tag ) {
return $milestone->title;
}
return version_compare( $milestone->title, $tag, '>' ) ? $milestone->title : $tag;
}
);
Expand Down
3 changes: 3 additions & 0 deletions .maintenance/src/Release_Notes_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ static function ( $latest, $milestone ) {
$milestone = array_reduce(
$milestones,
function ( $tag, $milestone ) {
if ( ! $tag ) {
return $milestone->title;
}
return version_compare( $milestone->title, $tag, '>' ) ? $milestone->title : $tag;
}
);
Expand Down

0 comments on commit 362abcc

Please sign in to comment.