2017-03-01 20:51:40 -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 20:51:40 -05:00
|
|
|
*
|
2021-02-04 11:57:01 -05:00
|
|
|
* PHP version 8
|
2017-03-01 20:51:40 -05:00
|
|
|
*
|
|
|
|
* @package HummingbirdAnimeClient
|
2022-03-04 12:32:17 -05:00
|
|
|
* @author Timothy J. Warren <tim@timshome.page>
|
|
|
|
* @copyright 2015 - 2022 Timothy J. Warren
|
2017-03-01 20:51:40 -05:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
2020-12-10 17:06:50 -05:00
|
|
|
* @version 5.2
|
2017-03-07 20:53:58 -05:00
|
|
|
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
|
2017-03-01 20:51:40 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\API\Mapping;
|
2017-03-02 11:12:19 -05:00
|
|
|
|
2018-08-22 13:43:04 -04:00
|
|
|
use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\{Anilist, Kitsu, Route, Title};
|
2017-03-01 20:51:40 -05:00
|
|
|
use Aviat\Ion\Enum;
|
|
|
|
|
2017-03-27 10:09:45 -04:00
|
|
|
/**
|
|
|
|
* Anime watching status mappings, among Kitsu, MAL, Page titles
|
|
|
|
* and url route segments
|
|
|
|
*/
|
2022-03-03 17:26:09 -05:00
|
|
|
final class AnimeWatchingStatus extends Enum
|
|
|
|
{
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ANILIST_TO_KITSU = [
|
2018-08-10 20:10:19 -04:00
|
|
|
Anilist::WATCHING => Kitsu::WATCHING,
|
|
|
|
Anilist::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
|
|
|
|
Anilist::COMPLETED => Kitsu::COMPLETED,
|
|
|
|
Anilist::ON_HOLD => Kitsu::ON_HOLD,
|
2022-03-03 17:26:09 -05:00
|
|
|
Anilist::DROPPED => Kitsu::DROPPED,
|
2018-08-10 20:10:19 -04:00
|
|
|
];
|
2018-11-09 10:38:35 -05:00
|
|
|
public const KITSU_TO_ANILIST = [
|
2018-08-10 20:10:19 -04:00
|
|
|
Kitsu::WATCHING => Anilist::WATCHING,
|
|
|
|
Kitsu::PLAN_TO_WATCH => Anilist::PLAN_TO_WATCH,
|
|
|
|
Kitsu::COMPLETED => Anilist::COMPLETED,
|
|
|
|
Kitsu::ON_HOLD => Anilist::ON_HOLD,
|
2022-03-03 17:26:09 -05:00
|
|
|
Kitsu::DROPPED => Anilist::DROPPED,
|
2018-08-10 20:10:19 -04:00
|
|
|
];
|
2018-11-09 10:38:35 -05:00
|
|
|
public const KITSU_TO_TITLE = [
|
2017-03-01 22:07:51 -05:00
|
|
|
Kitsu::WATCHING => Title::WATCHING,
|
|
|
|
Kitsu::PLAN_TO_WATCH => Title::PLAN_TO_WATCH,
|
|
|
|
Kitsu::ON_HOLD => Title::ON_HOLD,
|
|
|
|
Kitsu::DROPPED => Title::DROPPED,
|
2022-03-03 17:26:09 -05:00
|
|
|
Kitsu::COMPLETED => Title::COMPLETED,
|
2017-03-01 22:07:51 -05:00
|
|
|
];
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ROUTE_TO_KITSU = [
|
2017-03-01 22:07:51 -05:00
|
|
|
Route::WATCHING => Kitsu::WATCHING,
|
|
|
|
Route::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
|
|
|
|
Route::ON_HOLD => Kitsu::ON_HOLD,
|
|
|
|
Route::DROPPED => Kitsu::DROPPED,
|
2022-03-03 17:26:09 -05:00
|
|
|
Route::COMPLETED => Kitsu::COMPLETED,
|
2017-03-01 20:51:40 -05:00
|
|
|
];
|
2018-11-09 10:38:35 -05:00
|
|
|
public const ROUTE_TO_TITLE = [
|
2017-03-01 22:07:51 -05:00
|
|
|
Route::ALL => Title::ALL,
|
|
|
|
Route::WATCHING => Title::WATCHING,
|
|
|
|
Route::PLAN_TO_WATCH => Title::PLAN_TO_WATCH,
|
|
|
|
Route::ON_HOLD => Title::ON_HOLD,
|
|
|
|
Route::DROPPED => Title::DROPPED,
|
2022-03-03 17:26:09 -05:00
|
|
|
Route::COMPLETED => Title::COMPLETED,
|
2017-03-01 20:51:40 -05:00
|
|
|
];
|
2018-11-09 10:38:35 -05:00
|
|
|
public const TITLE_TO_ROUTE = [
|
2017-03-01 22:07:51 -05:00
|
|
|
Title::ALL => Route::ALL,
|
|
|
|
Title::WATCHING => Route::WATCHING,
|
|
|
|
Title::PLAN_TO_WATCH => Route::PLAN_TO_WATCH,
|
|
|
|
Title::ON_HOLD => Route::ON_HOLD,
|
|
|
|
Title::DROPPED => Route::DROPPED,
|
2022-03-03 17:26:09 -05:00
|
|
|
Title::COMPLETED => Route::COMPLETED,
|
2017-03-01 20:51:40 -05:00
|
|
|
];
|
2017-03-01 22:07:51 -05:00
|
|
|
}
|