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

Date type extension #1142

Merged
merged 7 commits into from
May 23, 2022
Merged

Date type extension #1142

merged 7 commits into from
May 23, 2022

Conversation

bastien-phi
Copy link
Contributor

@bastien-phi bastien-phi commented Feb 28, 2022

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Resolves #421. The code is taken from #438 and some tests were added.

I've been using initial implementation in projects for a long time and as I found a way to test it, I think it now deserves to be in this package.

Changes

Now, when using Date::use(CarbonImmutable::class), the helpers now(), today() and models' timestamps are determined to be CarbonImmutable.

It also adds an extension to determine return types of Illuminate\Support\Facade\Date methods when a custom date Factory is used (for exemple, Date::createFromString returns CarbonImmutable)

Breaking changes

I don't think so

@canvural canvural merged commit 1189b56 into larastan:master May 23, 2022
@canvural
Copy link
Collaborator

Thank you. Sorry for the delay!

@bastien-phi bastien-phi deleted the date_extension branch May 23, 2022 18:24
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.

now() helper & CarbonImmutable
2 participants