Skip to content

Commit

Permalink
expires_atをCarbon化
Browse files Browse the repository at this point in the history
  • Loading branch information
eai04191 committed Jan 16, 2019
1 parent 72c6ca4 commit e8c9de3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/MetadataResolver/KomifloResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace App\MetadataResolver;

use Carbon\Carbon;

class KomifloResolver implements Resolver
{
public function resolve(string $url): Metadata
Expand All @@ -22,7 +24,7 @@ public function resolve(string $url): Metadata
' - ' .
($json['content']['parents'][0]['data']['title'] ?? '?');
$metadata->image = $json['content']['cdn_public'] . "/564_mobile_large_3x/" . $json['content']['named_imgs']['cover']['filename'] . $json['content']['signature'];
$metadata->expires_at = date('Y-m-d H:i:s', strtotime($json['content']['signature_expires']));
$metadata->expires_at = Carbon::parse($json['content']['signature_expires']);

return $metadata;
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/MetadataResolver/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class Metadata
public $image = '';
/** @var Carbon|null */
public $expires_at = null;
}
}

0 comments on commit e8c9de3

Please sign in to comment.