Fix formatting
This commit is contained in:
parent
f2b7f61030
commit
351446a2ee
@ -36,7 +36,7 @@ final class AnimeTransformer extends AbstractTransformer
|
||||
$characters = [];
|
||||
$links = [];
|
||||
$staff = [];
|
||||
$rawGenres = array_filter($base['categories']['nodes'], static fn ($c) => $c !== null);
|
||||
$rawGenres = array_filter($base['categories']['nodes'], static fn ($c) => $c !== NULL);
|
||||
$genres = array_map(static fn ($genre) => $genre['title']['en'], $rawGenres);
|
||||
|
||||
sort($genres);
|
||||
|
@ -98,7 +98,7 @@ final class PersonTransformer extends AbstractTransformer
|
||||
{
|
||||
foreach ($data['voices']['nodes'] as $voicing)
|
||||
{
|
||||
if ($voicing === null)
|
||||
if ($voicing === NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ final class UserTransformer extends AbstractTransformer
|
||||
|
||||
return User::from([
|
||||
'about' => $base['about'] ?? '',
|
||||
'avatar' => $base['avatarImage']['original']['url'] ?? null,
|
||||
'birthday' => $base['birthday'] !== null ? Kitsu::formatDate($base['birthday']) . ' (' . Kitsu::friendlyTime(Kitsu::getDateDiff($base['birthday']), 'year') . ')' : null,
|
||||
'avatar' => $base['avatarImage']['original']['url'] ?? NULL,
|
||||
'birthday' => $base['birthday'] !== NULL ? Kitsu::formatDate($base['birthday']) . ' (' . Kitsu::friendlyTime(Kitsu::getDateDiff($base['birthday']), 'year') . ')' : NULL,
|
||||
'joinDate' => Kitsu::formatDate($base['createdAt']) . ' (' . Kitsu::friendlyTime(Kitsu::getDateDiff($base['createdAt']), 'day') . ' ago)',
|
||||
'gender' => $base['gender'],
|
||||
'favorites' => $this->organizeFavorites($favorites),
|
||||
@ -50,7 +50,7 @@ final class UserTransformer extends AbstractTransformer
|
||||
'slug' => $base['slug'],
|
||||
'stats' => $this->organizeStats($stats),
|
||||
'waifu' => $waifu,
|
||||
'website' => $base['siteLinks']['nodes'][0]['url'] ?? null,
|
||||
'website' => $base['siteLinks']['nodes'][0]['url'] ?? NULL,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -69,9 +69,10 @@ final class User extends BaseController
|
||||
: $username;
|
||||
|
||||
$rawData = $this->kitsuModel->getUserData($username);
|
||||
if ($rawData['data']['findProfileBySlug'] === null)
|
||||
if ($rawData['data']['findProfileBySlug'] === NULL)
|
||||
{
|
||||
$this->notFound('Sorry, user not found', "The user '$username' does not seem to exist.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ final class Kitsu
|
||||
$now = new DateTimeImmutable();
|
||||
$then = new DateTimeImmutable($date);
|
||||
|
||||
$interval = $now->diff($then, true);
|
||||
$interval = $now->diff($then, TRUE);
|
||||
|
||||
$years = $interval->y * self::SECONDS_IN_MINUTE * self::MINUTES_IN_YEAR;
|
||||
$days = $interval->d * self::SECONDS_IN_MINUTE * self::MINUTES_IN_DAY;
|
||||
|
Loading…
Reference in New Issue
Block a user