2017-03-01 21:52:30 -05:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
/**
|
|
|
|
* Hummingbird Anime List Client
|
|
|
|
*
|
2018-08-22 13:48:27 -04:00
|
|
|
* An API client for Kitsu to manage anime and manga watch lists
|
2017-03-01 21:52:30 -05:00
|
|
|
*
|
2020-04-10 15:39:39 -04:00
|
|
|
* PHP version 7.4
|
2017-03-01 21:52:30 -05:00
|
|
|
*
|
|
|
|
* @package HummingbirdAnimeClient
|
|
|
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
2020-01-08 15:39:49 -05:00
|
|
|
* @copyright 2015 - 2020 Timothy J. Warren
|
2017-03-01 21:52:30 -05:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
2020-08-04 09:30:21 -04:00
|
|
|
* @version 5.1
|
2017-03-07 20:53:58 -05:00
|
|
|
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
|
2017-03-01 21:52:30 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\API\Mapping;
|
|
|
|
|
2018-08-22 13:43:04 -04:00
|
|
|
use Aviat\AnimeClient\API\Enum\MangaReadingStatus\{Anilist, Kitsu, Title, Route};
|
2017-03-01 21:52:30 -05:00
|
|
|
use Aviat\Ion\Enum;
|
|
|
|
|
2017-03-27 10:09:45 -04:00
|
|
|
/**
|
|
|
|
* Manga reading status mappings, among Kitsu, MAL, Page titles
|
|
|
|
* and url route segments
|
|
|
|
*/
|
2018-08-08 10:12:45 -04:00
|
|
|
final class MangaReadingStatus extends Enum {
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ANILIST_TO_KITSU = [
|
2018-08-10 20:10:19 -04:00
|
|
|
Anilist::READING => Kitsu::READING,
|
|
|
|
Anilist::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
|
|
|
|
Anilist::COMPLETED => Kitsu::COMPLETED,
|
|
|
|
Anilist::ON_HOLD => Kitsu::ON_HOLD,
|
2018-08-22 13:43:04 -04:00
|
|
|
Anilist::DROPPED => Kitsu::DROPPED
|
2018-08-10 20:10:19 -04:00
|
|
|
];
|
2018-08-22 13:43:04 -04:00
|
|
|
|
2018-11-09 10:38:35 -05:00
|
|
|
public const KITSU_TO_ANILIST = [
|
2018-08-10 20:10:19 -04:00
|
|
|
Kitsu::READING => Anilist::READING,
|
|
|
|
Kitsu::PLAN_TO_READ => Anilist::PLAN_TO_READ,
|
|
|
|
Kitsu::COMPLETED => Anilist::COMPLETED,
|
|
|
|
Kitsu::ON_HOLD => Anilist::ON_HOLD,
|
|
|
|
Kitsu::DROPPED => Anilist::DROPPED
|
|
|
|
];
|
2017-03-01 21:52:30 -05:00
|
|
|
|
2018-11-09 10:38:35 -05:00
|
|
|
public const KITSU_TO_TITLE = [
|
2017-03-01 21:52:30 -05:00
|
|
|
Kitsu::READING => Title::READING,
|
|
|
|
Kitsu::PLAN_TO_READ => Title::PLAN_TO_READ,
|
|
|
|
Kitsu::COMPLETED => Title::COMPLETED,
|
|
|
|
Kitsu::ON_HOLD => Title::ON_HOLD,
|
2017-03-29 12:32:36 -04:00
|
|
|
Kitsu::DROPPED => Title::DROPPED,
|
2017-03-01 21:52:30 -05:00
|
|
|
];
|
|
|
|
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ROUTE_TO_KITSU = [
|
2017-03-01 21:52:30 -05:00
|
|
|
Route::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
|
|
|
|
Route::READING => Kitsu::READING,
|
|
|
|
Route::COMPLETED => Kitsu::COMPLETED,
|
|
|
|
Route::DROPPED => Kitsu::DROPPED,
|
2017-03-29 12:32:36 -04:00
|
|
|
Route::ON_HOLD => Kitsu::ON_HOLD,
|
2017-03-01 21:52:30 -05:00
|
|
|
];
|
|
|
|
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ROUTE_TO_TITLE = [
|
2017-03-01 21:52:30 -05:00
|
|
|
Route::ALL => Title::ALL,
|
|
|
|
Route::PLAN_TO_READ => Title::PLAN_TO_READ,
|
|
|
|
Route::READING => Title::READING,
|
|
|
|
Route::COMPLETED => Title::COMPLETED,
|
|
|
|
Route::DROPPED => Title::DROPPED,
|
2017-03-29 12:32:36 -04:00
|
|
|
Route::ON_HOLD => Title::ON_HOLD,
|
2017-03-01 21:52:30 -05:00
|
|
|
];
|
|
|
|
|
2018-11-09 10:38:35 -05:00
|
|
|
public const TITLE_TO_KITSU = [
|
2017-03-01 21:52:30 -05:00
|
|
|
Title::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
|
|
|
|
Title::READING => Kitsu::READING,
|
|
|
|
Title::COMPLETED => Kitsu::COMPLETED,
|
|
|
|
Title::DROPPED => Kitsu::DROPPED,
|
2017-03-29 12:32:36 -04:00
|
|
|
Title::ON_HOLD => Kitsu::ON_HOLD,
|
2017-03-01 21:52:30 -05:00
|
|
|
];
|
|
|
|
}
|