Skip to content

Conversation

@maltehuebner
Copy link
Contributor

Summary

  • Fix bug where DateTimeImmutable::sub() return value was discarded
  • Method was always comparing against "now" instead of "one week ago"

Problem

// Before: sub() return value lost
$dateTime = new \DateTimeImmutable();
$dateTime->sub(new \DateInterval('P1W')); // returns new object, ignored
return $dateTime >= $this->dateTime;      // always compares with "now"

Test plan

  • Verify that isIndexable() correctly returns true only for data older than 1 week

🤖 Generated with Claude Code

DateTimeImmutable::sub() returns a new instance instead of mutating.
The result was discarded, so the comparison always used "now" instead
of one week ago.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant