Skip to content

Commit

Permalink
Merge pull request #46 from sebastiandedeyne/datetime-expires-attribute
Browse files Browse the repository at this point in the history
Use DateTimeInterface for Xero token expires attribute
  • Loading branch information
dcblogdev authored Feb 28, 2024
2 parents 7090c3d + 06babe7 commit 6ea2553
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Models/XeroToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Dcblogdev\Xero\Models;

use Carbon\Carbon;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;

Expand All @@ -11,12 +11,12 @@ class XeroToken extends Model
protected $guarded = [];

/**
* @return \Illuminate\Database\Eloquent\Casts\Attribute<Carbon, never>
* @return \Illuminate\Database\Eloquent\Casts\Attribute<DateTimeInterface, never>
*/
protected function expires(): Attribute
{
return Attribute::get(
fn(): Carbon => $this->updated_at->addSeconds($this->expires_in)
fn(): DateTimeInterface => $this->updated_at->addSeconds($this->expires_in)
);
}
}

0 comments on commit 6ea2553

Please sign in to comment.