Skip to content

Add ReturnTypeWillChange to createFromTimestamp #22

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

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

cdburgess
Copy link
Contributor

When using PHP 8.4, I get the following error:

Deprecated: Return type of Carbon\Traits\Date::createFromTimestamp($timestamp, $tz = null) should either be compatible with DateTime::createFromTimestamp(int|float $timestamp): static, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in nesbot/carbon/src/Carbon/Traits/Timestamp.php on line 29

I am adding the annotation to resolve this issue.

When using PHP 8.4, I get the following error: 

```
Deprecated: Return type of Carbon\Traits\Date::createFromTimestamp($timestamp, $tz = null) should either be compatible with DateTime::createFromTimestamp(int|float $timestamp): static, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in nesbot/carbon/src/Carbon/Traits/Timestamp.php on line 29
```

I am adding the annotation to resolve this issue.
@cdburgess
Copy link
Contributor Author

Not sure what is going on with these tests, but it certainly couldn't be from a single annotation.

@kylekatarnls kylekatarnls changed the title Update Timestamp.php Add ReturnTypeWillChange to createFromTimestamp Feb 21, 2025
@kylekatarnls kylekatarnls added this to the 3.8.7 milestone Feb 21, 2025
@kylekatarnls kylekatarnls merged commit 47c0dd7 into CarbonPHP:master Feb 21, 2025
25 checks passed
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.

2 participants