Skip to content

Allow DateTimeInterfaces in BlameTimestampSubscriber #7797

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

Closed
wants to merge 5 commits into from

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented Feb 6, 2025

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets -
Related issues/PRs #7795 #7792
License MIT
Documentation PR -

What's in this PR?

  • Using DateTimeInterface instead of DateTime in the mapTimestamp
  • Using php 8 feature of optional chaining

Why?

Preparation for using the immutable version of the DateTime.

Comment on lines +20 to +21
use TimestampableTrait;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this should be the only implementation on how to handle the changed and created state.

@mamazu mamazu force-pushed the timestampable_preparation branch 2 times, most recently from 7f853b2 to 9bfb888 Compare February 6, 2025 17:13
@mamazu
Copy link
Contributor Author

mamazu commented Feb 9, 2025

This could also be downported to 2.5.

@mamazu
Copy link
Contributor Author

mamazu commented Feb 10, 2025

@alexander-schranz Should I downport these changes to 2.5 seeing that I will get problems when merging the baseline anyways?

@mamazu mamazu force-pushed the timestampable_preparation branch from b22ce2f to 97df34f Compare February 10, 2025 12:51
@mamazu mamazu changed the base branch from 2.6 to 2.5 February 10, 2025 12:52
@mamazu mamazu force-pushed the timestampable_preparation branch from f37dc46 to d49faa8 Compare March 8, 2025 16:29
@mamazu mamazu changed the title Allow DateTimeInterfaces in BlameTimestampSubscriber Allow DateTimeInterfaces in BlameTimestampSubscriber Mar 18, 2025
@mamazu mamazu added the DX Affecting the end developer label Apr 4, 2025
@mamazu
Copy link
Contributor Author

mamazu commented May 23, 2025

@wachterjohannes Here is the PR that can even be merged into 2.5 without bc breaks for the types in the mapper. Just waiting for a merge.

@wachterjohannes
Copy link
Member

@mamazu & @alexander-schranz do we really want to use datetimeinterface? i would keep in 2.5 and 2.6 the datetime and change that for 3.0 to immutable - dont see the benefits here

@alexander-schranz
Copy link
Member

@wachterjohannes I personal would go for 3.0 with datetimeimmutable.

@wachterjohannes
Copy link
Member

@alexander-schranz OK then i will close this MR.

@mamazu this change does not have any impact on the code for pre 3.0 so we close it. Additionally to that i have updated the MR for 3.0 with DateTimeImmutable.

@mamazu mamazu deleted the timestampable_preparation branch May 26, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants