Skip to content

Commit 786d1c5

Browse files
authored
Fix: Add return type declarations (#865)
1 parent a528e6e commit 786d1c5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

images/supported-versions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ function branches_to_show() {
2727
return $branches;
2828
}
2929

30-
function min_date() {
30+
function min_date(): DateTime
31+
{
3132
$now = new DateTime('January 1');
3233
return $now->sub(new DateInterval('P3Y'));
3334
}
3435

35-
function max_date() {
36+
function max_date(): DateTime
37+
{
3638
$now = new DateTime('January 1');
3739
return $now->add(new DateInterval('P5Y'));
3840
}

include/branches.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ function get_final_release($branch) {
286286
return null;
287287
}
288288

289-
function get_branch_bug_eol_date($branch) {
289+
function get_branch_bug_eol_date($branch): ?DateTime
290+
{
290291
if (isset($GLOBALS['BRANCHES'][$branch]['stable'])) {
291292
return new DateTime($GLOBALS['BRANCHES'][$branch]['stable']);
292293
}
@@ -296,7 +297,8 @@ function get_branch_bug_eol_date($branch) {
296297
return $date ? $date->add(new DateInterval('P2Y')) : null;
297298
}
298299

299-
function get_branch_security_eol_date($branch) {
300+
function get_branch_security_eol_date($branch): ?DateTime
301+
{
300302
if (isset($GLOBALS['BRANCHES'][$branch]['security'])) {
301303
return new DateTime($GLOBALS['BRANCHES'][$branch]['security']);
302304
}
@@ -313,7 +315,8 @@ function get_branch_security_eol_date($branch) {
313315
return $date ? $date->add(new DateInterval('P3Y')) : null;
314316
}
315317

316-
function get_branch_release_date($branch) {
318+
function get_branch_release_date($branch): ?DateTime
319+
{
317320
$initial = get_initial_release($branch);
318321

319322
return $initial ? new DateTime($initial['date']) : null;

0 commit comments

Comments
 (0)