Make sure mapping is accurately named

\!
This commit is contained in:
Timothy Warren 2017-03-03 11:51:53 -05:00
parent e4f6db8229
commit 15b6d492f1
2 changed files with 12 additions and 12 deletions

View File

@ -17,10 +17,10 @@
namespace Aviat\AnimeClient\API\MAL; namespace Aviat\AnimeClient\API\MAL;
use Amp\Artax\Request; use Amp\Artax\Request;
use Aviat\AnimeClient\API\MAL as M;
use Aviat\AnimeClient\API\MAL\ListItem; use Aviat\AnimeClient\API\MAL\ListItem;
use Aviat\AnimeClient\API\MAL\Transformer\AnimeListTransformer; use Aviat\AnimeClient\API\MAL\Transformer\AnimeListTransformer;
use Aviat\AnimeClient\API\XML; use Aviat\AnimeClient\API\XML;
use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus;
use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerAware;
/** /**
@ -61,7 +61,7 @@ class Model {
$createData = [ $createData = [
'id' => $data['id'], 'id' => $data['id'],
'data' => [ 'data' => [
'status' => M::KITSU_MAL_WATCHING_STATUS_MAP[$data['status']] 'status' => AnimeWatchingStatus::KITSU_TO_MAL[$data['status']]
] ]
]; ];

View File

@ -25,7 +25,7 @@ use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\{
use Aviat\Ion\Enum; use Aviat\Ion\Enum;
class AnimeWatchingStatus extends Enum { class AnimeWatchingStatus extends Enum {
const MAL_TO_KITSU = [ const KITSU_TO_MAL = [
Kitsu::WATCHING => MAL::WATCHING, Kitsu::WATCHING => MAL::WATCHING,
Kitsu::PLAN_TO_WATCH => MAL::PLAN_TO_WATCH, Kitsu::PLAN_TO_WATCH => MAL::PLAN_TO_WATCH,
Kitsu::COMPLETED => MAL::COMPLETED, Kitsu::COMPLETED => MAL::COMPLETED,
@ -33,14 +33,6 @@ class AnimeWatchingStatus extends Enum {
Kitsu::DROPPED => MAL::DROPPED Kitsu::DROPPED => MAL::DROPPED
]; ];
const KITSU_TO_MAL = [
MAL::WATCHING => Kitsu::WATCHING,
MAL::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
MAL::COMPLETED => Kitsu::COMPLETED,
MAL::ON_HOLD => Kitsu::ON_HOLD,
MAL::DROPPED => Kitsu::DROPPED
];
const KITSU_TO_TITLE = [ const KITSU_TO_TITLE = [
'all' => Title::ALL, 'all' => Title::ALL,
Kitsu::WATCHING => Title::WATCHING, Kitsu::WATCHING => Title::WATCHING,
@ -50,6 +42,14 @@ class AnimeWatchingStatus extends Enum {
Kitsu::COMPLETED => Title::COMPLETED Kitsu::COMPLETED => Title::COMPLETED
]; ];
const MAL_TO_KITSU = [
MAL::WATCHING => Kitsu::WATCHING,
MAL::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
MAL::COMPLETED => Kitsu::COMPLETED,
MAL::ON_HOLD => Kitsu::ON_HOLD,
MAL::DROPPED => Kitsu::DROPPED
];
const ROUTE_TO_KITSU = [ const ROUTE_TO_KITSU = [
Route::WATCHING => Kitsu::WATCHING, Route::WATCHING => Kitsu::WATCHING,
Route::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH, Route::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,