Skip to content

Commit e367a4a

Browse files
drealecsderickr
authored andcommitted
Update the end of release cycle based on approved https://wiki.php.net/rfc/release_cycle_update
1 parent 1f65eee commit e367a4a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

include/branches.inc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,15 @@ function get_branch_bug_eol_date($branch): ?DateTime
306306

307307
$date = get_branch_release_date($branch);
308308

309-
return $date ? $date->add(new DateInterval('P2Y')) : null;
309+
$date = $date?->add(new DateInterval('P2Y'));
310+
311+
// Versions before 8.2 do not extend the release cycle to the end of the year
312+
if (version_compare($branch, '8.2', '<')) {
313+
return $date;
314+
}
315+
316+
// Extend the release cycle to the end of the year
317+
return $date?->setDate($date->format('Y'), 12, 31);
310318
}
311319

312320
function get_branch_security_eol_date($branch): ?DateTime
@@ -324,7 +332,16 @@ function get_branch_security_eol_date($branch): ?DateTime
324332
}
325333

326334
$date = get_branch_release_date($branch);
327-
return $date ? $date->add(new DateInterval('P3Y')) : null;
335+
336+
// Versions before 8.1 have 3-year support since the initial release
337+
if (version_compare($branch, '8.1', '<')) {
338+
return $date?->add(new DateInterval('P3Y'));
339+
}
340+
341+
$date = $date?->add(new DateInterval('P4Y'));
342+
343+
// Extend the release cycle to the end of the year
344+
return $date?->setDate($date->format('Y'), 12, 31);
328345
}
329346

330347
function get_branch_release_date($branch): ?DateTime

0 commit comments

Comments
 (0)