Skip to content

Commit 65186ec

Browse files
committed
formatted sources
1 parent 0c36c26 commit 65186ec

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

app/Http/Controllers/TwitchController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ public function subEmotes(Request $request, $channel = null)
18331833
{
18341834
$channel = $channel ?: $request->input('channel', null);
18351835
$wantsJson = (($request->wantsJson() || $request->exists('json')) ? true : false);
1836-
$wantsPlans = ($request -> exists('tiers') && $wantsJson);
1836+
$wantsPlans = ($request->exists('tiers') && $wantsJson);
18371837
$id = $request->input('id', 'false');
18381838

18391839
if (empty($channel)) {

app/Http/Resources/TwitchEmotes/Plans.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<?php
22

3-
// aaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
4-
53
namespace App\Http\Resources\TwitchEmotes;
64

75
use Illuminate\Http\Resources\Json\ResourceCollection;
8-
use Log;
96

107
class 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

Comments
 (0)