API client for Kitsu.io, with optional Anime collection, and optional Anilist syncing.
anime
manga
kitsu
anilist
single-user

MangaReadingStatus.php 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php declare(strict_types=1);
  2. /**
  3. * Hummingbird Anime List Client
  4. *
  5. * An API client for Kitsu and MyAnimeList to manage anime and manga watch lists
  6. *
  7. * PHP version 7
  8. *
  9. * @package HummingbirdAnimeClient
  10. * @author Timothy J. Warren <tim@timshomepage.net>
  11. * @copyright 2015 - 2018 Timothy J. Warren
  12. * @license http://www.opensource.org/licenses/mit-license.html MIT License
  13. * @version 4.0
  14. * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
  15. */
  16. namespace Aviat\AnimeClient\API\Mapping;
  17. use Aviat\AnimeClient\API\Enum\MangaReadingStatus\{Kitsu, MAL, Title, Route};
  18. use Aviat\Ion\Enum;
  19. /**
  20. * Manga reading status mappings, among Kitsu, MAL, Page titles
  21. * and url route segments
  22. */
  23. final class MangaReadingStatus extends Enum {
  24. const KITSU_TO_MAL = [
  25. Kitsu::READING => MAL::READING,
  26. Kitsu::PLAN_TO_READ => MAL::PLAN_TO_READ,
  27. Kitsu::COMPLETED => MAL::COMPLETED,
  28. Kitsu::ON_HOLD => MAL::ON_HOLD,
  29. Kitsu::DROPPED => MAL::DROPPED
  30. ];
  31. const MAL_TO_KITSU = [
  32. '1' => Kitsu::READING,
  33. '2' => Kitsu::COMPLETED,
  34. '3' => Kitsu::ON_HOLD,
  35. '4' => Kitsu::DROPPED,
  36. '6' => Kitsu::PLAN_TO_READ,
  37. MAL::READING => Kitsu::READING,
  38. MAL::COMPLETED => Kitsu::COMPLETED,
  39. MAL::ON_HOLD => Kitsu::ON_HOLD,
  40. MAL::DROPPED => Kitsu::DROPPED,
  41. MAL::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
  42. ];
  43. const KITSU_TO_TITLE = [
  44. Kitsu::READING => Title::READING,
  45. Kitsu::PLAN_TO_READ => Title::PLAN_TO_READ,
  46. Kitsu::COMPLETED => Title::COMPLETED,
  47. Kitsu::ON_HOLD => Title::ON_HOLD,
  48. Kitsu::DROPPED => Title::DROPPED,
  49. ];
  50. const ROUTE_TO_KITSU = [
  51. Route::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
  52. Route::READING => Kitsu::READING,
  53. Route::COMPLETED => Kitsu::COMPLETED,
  54. Route::DROPPED => Kitsu::DROPPED,
  55. Route::ON_HOLD => Kitsu::ON_HOLD,
  56. ];
  57. const ROUTE_TO_TITLE = [
  58. Route::ALL => Title::ALL,
  59. Route::PLAN_TO_READ => Title::PLAN_TO_READ,
  60. Route::READING => Title::READING,
  61. Route::COMPLETED => Title::COMPLETED,
  62. Route::DROPPED => Title::DROPPED,
  63. Route::ON_HOLD => Title::ON_HOLD,
  64. ];
  65. const TITLE_TO_KITSU = [
  66. Title::PLAN_TO_READ => Kitsu::PLAN_TO_READ,
  67. Title::READING => Kitsu::READING,
  68. Title::COMPLETED => Kitsu::COMPLETED,
  69. Title::DROPPED => Kitsu::DROPPED,
  70. Title::ON_HOLD => Kitsu::ON_HOLD,
  71. ];
  72. }