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

[3.x] Add support for CarbonImmutable #85

Closed
3 of 4 tasks
saineshmamgain opened this issue May 7, 2024 · 0 comments
Closed
3 of 4 tasks

[3.x] Add support for CarbonImmutable #85

saineshmamgain opened this issue May 7, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@saineshmamgain
Copy link

saineshmamgain commented May 7, 2024

Please check these requirements

  • This feature helps everyone using this package
  • It's feasible and maintainable
  • It's non breaking
  • I issued a PR with the implementation (optional)

Description

Currently the method expiresAt of class Laragear\WebAuthn\Challenge\Challenge expects the return type to be Carbon. And since it uses Date facade by default it will return Carbon only. But for projects where Date facade uses CarbonImmutable handler using Date::use(CarbonImmutable::class); this method will break as the return value from Date facade will be an instance of CarbonImmutable. We can add the return type of expiresAt as CarbonInterface to support both Carbon and CarbonImmutable.

Feel free to close this issue if it is of not that importance.

Code sample

use Carbon\CarbonInterface;

public function expiresAt(): CarbonInterface
{
    return Date::createFromTimestamp($this->expiresAt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants