Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail date validation on PHP >= 8.2 #2030

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/cdash/app/Controller/Api/ResultsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ public function getEndDate()
public function validateDateString($date)
{
$dt = \DateTime::createFromFormat("Y-m-d", $date);
if ($dt !== false && !array_sum($dt::getLastErrors())) {
return $date;
if ($dt !== false) {
$err = $dt::getLastErrors();
if ($err === false || array_sum($err) === 0) {
return $date;
}
}
return false;
}
Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5588,16 +5588,6 @@ parameters:
count: 1
path: app/cdash/app/Controller/Api/ResultsApi.php

-
message: "#^Only booleans are allowed in a negated boolean, \\(float\\|int\\) given\\.$#"
count: 1
path: app/cdash/app/Controller/Api/ResultsApi.php

-
message: "#^Parameter \\#1 \\$array of function array_sum expects array, array\\<string, array\\<int, string\\>\\|int\\>\\|false given\\.$#"
count: 1
path: app/cdash/app/Controller/Api/ResultsApi.php

-
message: "#^Property CDash\\\\Controller\\\\Api\\\\ResultsApi\\:\\:\\$beginDate has no type specified\\.$#"
count: 1
Expand Down