Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
3 changed files with 10 additions and 9 deletions
Showing only changes of commit 332ff72360 - Show all commits

View File

@ -225,9 +225,11 @@ final class Kitsu {
// The 'canonical' title is always returned
$valid = [$data['canonicalTitle']];
if (array_key_exists('titles', $data))
foreach (['titles', 'abbreviatedTitles'] as $key)
{
foreach($data['titles'] as $alternateTitle)
if (array_key_exists($key, $data) && is_array($data[$key]))
{
foreach($data[$key] as $alternateTitle)
{
if (self::titleIsUnique($alternateTitle, $valid))
{
@ -235,6 +237,7 @@ final class Kitsu {
}
}
}
}
return $valid;
}

View File

@ -98,12 +98,12 @@ final class MangaTransformer extends AbstractTransformer {
if ( ! empty($characters['main']))
{
uasort($characters['main'], fn ($a, $b) => $a['name'] <=> $b['anime']);
uasort($characters['main'], fn ($a, $b) => $a['name'] <=> $b['name']);
}
if ( ! empty($characters['supporting']))
{
uasort($characters['supporting'], fn ($a, $b) => $a['name'] <=> $b['anime']);
uasort($characters['supporting'], fn ($a, $b) => $a['name'] <=> $b['name']);
}
ksort($characters);

View File

@ -103,9 +103,7 @@ final class ParallelAPIRequest {
foreach ($this->requests as $key => $url)
{
$promises[$key] = call(static function () use ($client, $url) {
return yield $client->request($url);
});
$promises[$key] = call(fn () => yield $client->request($url));
}
return wait(all($promises));