Skip to content

Commit 362abcc

Browse files
committed
Don’t run version_compare with null
I ran into deprecation warnings where `$tag` was `null` when running these commands in preparation for the 2.9.0 release
1 parent 6a909c2 commit 362abcc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.maintenance/src/Contrib_List_Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public function __invoke( $args, $assoc_args ) {
123123
$milestone = array_reduce(
124124
$milestones,
125125
function ( $tag, $milestone ) {
126+
if ( ! $tag ) {
127+
return $milestone->title;
128+
}
126129
return version_compare( $milestone->title, $tag, '>' ) ? $milestone->title : $tag;
127130
}
128131
);

.maintenance/src/Release_Notes_Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ static function ( $latest, $milestone ) {
115115
$milestone = array_reduce(
116116
$milestones,
117117
function ( $tag, $milestone ) {
118+
if ( ! $tag ) {
119+
return $milestone->title;
120+
}
118121
return version_compare( $milestone->title, $tag, '>' ) ? $milestone->title : $tag;
119122
}
120123
);

0 commit comments

Comments
 (0)