From 27977a0c8a5d5d82c14a94bb0becc934e0e125d5 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 8 Nov 2018 11:36:42 -0500 Subject: [PATCH] Move data transformation out of controllers, and into transformers --- app/views/anime/details.php | 44 ++-- app/views/character/details.php | 135 ++++++------- app/views/person/character-mapping.php | 2 +- app/views/person/details.php | 8 +- app/views/user/details.php | 64 ++---- .../Transformer/AnimeListTransformer.php | 5 +- .../Kitsu/Transformer/AnimeTransformer.php | 74 ++++++- .../Transformer/CharacterTransformer.php | 173 ++++++++++++++++ .../Kitsu/Transformer/PersonTransformer.php | 132 ++++++++++++ src/API/Kitsu/Transformer/UserTransformer.php | 147 ++++++++++++++ src/Controller/Anime.php | 72 +------ src/Controller/Character.php | 191 +++--------------- src/Controller/People.php | 136 +++---------- src/Controller/Settings.php | 30 ++- src/Controller/User.php | 108 ++-------- src/Types/Anime.php | 4 +- src/Types/AnimeListItem.php | 7 +- src/Types/AnimePage.php | 25 +++ src/Types/Character.php | 39 ++++ src/Types/Person.php | 35 ++++ src/Types/User.php | 32 +++ ...AnimeTransformerTest__testTransform__1.php | 8 +- 22 files changed, 870 insertions(+), 601 deletions(-) create mode 100644 src/API/Kitsu/Transformer/CharacterTransformer.php create mode 100644 src/API/Kitsu/Transformer/PersonTransformer.php create mode 100644 src/API/Kitsu/Transformer/UserTransformer.php create mode 100644 src/Types/AnimePage.php create mode 100644 src/Types/Character.php create mode 100644 src/Types/Person.php create mode 100644 src/Types/User.php diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 3460dd2b..dd167b36 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -2,52 +2,52 @@
-

- +

+


-

- 0): ?> +

+ 0): ?>

Streaming on:

@@ -59,13 +59,13 @@ - + - +

Trailer