You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, apologies to disregard the template. I'd like to get straight to the point on a few issues.
Expired records are not excluded by default, which isn't expected behaviour and causes end users to hack up their own way (this should be done in the apply method of the scope class).
Regarding setExpiresAtAttribute:
Setting the value of expires_at is very weird - there's a lot of funny parsing going on when instead it should have been a simple is_int($x) ? Carbon::now()->addSeconds($x) : $x - the current code somehow doesn't work for me in a simple test with timestamps and Carbon::setTestNow()
If the dev named the column something else the setExpiresAtAttribute code will not be triggered for the other column name - this could be confusing/misleading
Regarding the Expirable trait:
It is missing method PHPDoc (it should document the macros from ExpiringScope).
Instead of redeclaring @property $attributes and @property $dates in that trait, maybe use @mixin HasAttributes instead.
Careful that even if getSeconds trait method is protected, it could come down to some nasty incompatibility with other traits or implementing class. Same situation with importing all the methods from InteractsWithTime trait.
I'd consider better names for the macros, for example Subscription::withoutExpiration is more idiomatic than notExpiring.
On a different perspective, there's a competing package that solves some issues above but has its own problems.
Maybe consider partnering up to bring the best of both?
The text was updated successfully, but these errors were encountered:
First of all, apologies to disregard the template. I'd like to get straight to the point on a few issues.
apply
method of the scope class).setExpiresAtAttribute
:expires_at
is very weird - there's a lot of funny parsing going on when instead it should have been a simpleis_int($x) ? Carbon::now()->addSeconds($x) : $x
- the current code somehow doesn't work for me in a simple test with timestamps andCarbon::setTestNow()
setExpiresAtAttribute
code will not be triggered for the other column name - this could be confusing/misleadingExpirable
trait:ExpiringScope
).@property $attributes
and@property $dates
in that trait, maybe use@mixin HasAttributes
instead.getSeconds
trait method is protected, it could come down to some nasty incompatibility with other traits or implementing class. Same situation with importing all the methods fromInteractsWithTime
trait.Subscription::withoutExpiration
is more idiomatic thannotExpiring
.On a different perspective, there's a competing package that solves some issues above but has its own problems.
Maybe consider partnering up to bring the best of both?
The text was updated successfully, but these errors were encountered: