11<?php
22
3- // aaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
4-
53namespace App \Http \Resources \TwitchEmotes ;
64
75use Illuminate \Http \Resources \Json \ResourceCollection ;
8- use Log ;
96
107class Plans extends ResourceCollection
118{
12- // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
9+ // Should convert the resource into an array
1310 public function toArray ($ request )
1411 {
1512 $ res = $ this ->resource ;
@@ -21,18 +18,19 @@ public function toArray($request)
2118 ];
2219 }
2320
24- // sorts emotes by plan name, e.g. all emotes from 4.99 set would be together in one key ("$4.99")
25- // so yeah.. I know this could be done better
26- // for example, it could return tier1, tier2, tier3 instead of dollar values
27- // ^ EDIT: covered in TwitchController though it still feels wrong ^
28- // how do i do that documentation thing?
21+ /**
22+ * Sorts emotes by their tier, returns them as an array
23+ *
24+ * @param array $emotes
25+ * @return array
26+ */
2927 public function sortEmotes ($ emotes )
3028 {
3129 return $ this ->collection
32- ->map (function ($ plans, $ AAAAAa ) use ($ emotes ){
33- $ accumulator = array () ;
34- foreach ($ emotes as $ emote ){
35- if ($ emote ['emoticon_set ' ] == $ plans ){
30+ ->map (function ($ plans ) use ($ emotes ){
31+ $ accumulator = [] ;
32+ foreach ($ emotes as $ emote ){
33+ if ($ emote ['emoticon_set ' ] == $ plans ){
3634 array_push ($ accumulator , $ emote ['code ' ]);
3735 };
3836 }
0 commit comments