Repository navigation
Commit 2b500b4
Give the modification date a type PHPStan can follow
The pair was collected into an array with both keys optional, so nothing
told PHPStan that reaching the consistency check meant at least one of them
was present, and the values stayed mixed all the way into
get_gmt_from_date() and get_date_from_gmt().
Two scalars say the same thing in a way the analyser can follow, and the
array is built once both are known. is_scalar() guards the cast: a value
that is not scalar could not be a date anyway, and casting one to string is
what the strict rule is there to prevent.
No behaviour change - `! empty()` still decides whether each was given, and
the pair is still completed from whichever half arrived.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014SSZzqMJRDTiLiDxQEPYcL1 parent 8ff4d0c commit 2b500b4
1 file changed
Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
301 | 300 | | |
302 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
| |||
0 commit comments