[X] This feature helps everyone using this package
[X] It's feasible and maintainable
[X] 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);
}
Please check these requirements
Description
Currently the method
expiresAt
of classLaragear\WebAuthn\Challenge\Challenge
expects the return type to be Carbon. And since it usesDate
facade by default it will returnCarbon
only. But for projects whereDate
facade usesCarbonImmutable
handler usingDate::use(CarbonImmutable::class);
this method will break as the return value from Date facade will be an instance ofCarbonImmutable
. We can add the return type ofexpiresAt
asCarbonInterface
to support bothCarbon
andCarbonImmutable
.Feel free to close this issue if it is of not that importance.
Code sample