| @@ -96,7 +96,7 @@ | ||
| 96 | 96 | * | 
| 97 | 97 | * @codeCoverageIgnore | 
| 98 | 98 | * | 
| 99 | - * @return Response | |
| 99 | + * @return \Illuminate\Http\RedirectResponse | |
| 100 | 100 | */ | 
| 101 | 101 | public function handleProviderCallback($provider) | 
| 102 | 102 |      { | 
| @@ -2,8 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | -use Illuminate\Http\Request; | |
| 6 | -use LearnParty\Http\Requests; | |
| 7 | 5 | use LearnParty\Category; | 
| 8 | 6 | |
| 9 | 7 | class CategoryController extends Controller | 
| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 | * to | 
| 29 | 29 | * | 
| 30 | 30 | * @param VideoRequest $request Request | 
| 31 | - * @return Redirect to create page | |
| 31 | + * @return \Illuminate\Http\RedirectResponse to create page | |
| 32 | 32 | */ | 
| 33 | 33 | public function store(VideoRequest $request) | 
| 34 | 34 |      { | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | * | 
| 66 | 66 | * @param VideoRequest $request Validation request | 
| 67 | 67 | * @param integer $id Video Id | 
| 68 | - * @return Redirect Redirect to episode page | |
| 68 | + * @return \Illuminate\Http\RedirectResponse Redirect to episode page | |
| 69 | 69 | */ | 
| 70 | 70 | public function update(VideoRequest $request, $id) | 
| 71 | 71 |      { | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 | $newVideo = Auth::user()->videos()->create($request->all()); | 
| 38 | 38 |          $newVideo->categories()->sync($request->input('category_list')); | 
| 39 | 39 | |
| 40 | -        return redirect('videos/' . $newVideo->id); | |
| 40 | +        return redirect('videos/'.$newVideo->id); | |
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | /** | 
| @@ -82,7 +82,7 @@ discard block | ||
| 82 | 82 |          $request->session()->flash('status', 'success'); | 
| 83 | 83 |          $request->session()->flash('message', 'Video successfully updated.'); | 
| 84 | 84 | |
| 85 | -        return redirect('dashboard/videos/' . $id . '/edit'); | |
| 85 | +        return redirect('dashboard/videos/'.$id.'/edit'); | |
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | 88 | /** | 
| @@ -116,7 +116,7 @@ discard block | ||
| 116 | 116 |          $videos = Video::whereIn('id', Auth::user()->favorites->lists('video_id')->toArray()); | 
| 117 | 117 | $favorites = []; | 
| 118 | 118 | |
| 119 | -        $videos->each(function ($video, $Key) use (&$favorites) { | |
| 119 | +        $videos->each(function($video, $Key) use (&$favorites) { | |
| 120 | 120 | $favorites[$video->id] = $video->favorites->count(); | 
| 121 | 121 | }); | 
| 122 | 122 | |
| @@ -3,7 +3,6 @@ | ||
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; | 
| 6 | -use LearnParty\Http\Requests; | |
| 7 | 6 | use LearnParty\User; | 
| 8 | 7 | use Auth; | 
| 9 | 8 | |
| @@ -3,9 +3,7 @@ | ||
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; | 
| 6 | -use LearnParty\Http\Requests; | |
| 7 | 6 | use LearnParty\Favorite; | 
| 8 | -use LearnParty\Video; | |
| 9 | 7 | use Auth; | 
| 10 | 8 | |
| 11 | 9 | class FavoritesController extends Controller | 
| @@ -21,8 +21,8 @@ | ||
| 21 | 21 |      { | 
| 22 | 22 | $request['user_id'] = Auth::user()->id; | 
| 23 | 23 |          $favorite = Favorite::where('user_id', Auth::user()->id) | 
| 24 | -                       ->where('video_id', $request->input('video_id')) | |
| 25 | - ->get(); | |
| 24 | +                        ->where('video_id', $request->input('video_id')) | |
| 25 | + ->get(); | |
| 26 | 26 | |
| 27 | 27 |          if ($favorite->count() === 0) { | 
| 28 | 28 | return $this->videoRepository->favoriteVideo($request->all()); | 
| @@ -2,8 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | -use LearnParty\Http\Requests; | |
| 6 | -use Illuminate\Http\Request; | |
| 7 | 5 | use LearnParty\Video; | 
| 8 | 6 | |
| 9 | 7 | class HomeController extends Controller | 
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | * upload an avatar to cloudinary and return url. | 
| 47 | 47 | * | 
| 48 | 48 | * @param Request $request Request from user | 
| 49 | - * @return Object redirect to profile page | |
| 49 | + * @return \Illuminate\Http\RedirectResponse redirect to profile page | |
| 50 | 50 | */ | 
| 51 | 51 | public function updateAvatar(Request $request) | 
| 52 | 52 |      { | 
| @@ -3,7 +3,6 @@ | ||
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; | 
| 6 | -use LearnParty\Http\Requests; | |
| 7 | 6 | use LearnParty\User; | 
| 8 | 7 | use Auth; | 
| 9 | 8 | |
| @@ -2,11 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace LearnParty\Http\Controllers; | 
| 4 | 4 | |
| 5 | -use Illuminate\Http\Request; | |
| 6 | -use LearnParty\Http\Requests; | |
| 7 | 5 | use LearnParty\Video; | 
| 8 | -use LearnParty\Comment; | |
| 9 | -use LearnParty\User; | |
| 10 | 6 | |
| 11 | 7 | class VideoController extends Controller | 
| 12 | 8 |  { | 
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | /** | 
| 41 | 41 | * upload an avatar to cloudinary and return url | 
| 42 | 42 | * | 
| 43 | - * @param Request $request Request from user | |
| 43 | + * @param \Illuminate\Http\Request $request Request from user | |
| 44 | 44 | * @return string Cloudinary Url | 
| 45 | 45 | */ | 
| 46 | 46 | public function uploadAvatar($request) | 
| @@ -2,9 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace LearnParty\Http\Repositories; | 
| 4 | 4 | |
| 5 | -use Illuminate\Contracts\Filesystem\Filesystem; | |
| 6 | 5 | use LearnParty\User; | 
| 7 | -use Storage; | |
| 8 | 6 | use Auth; | 
| 9 | 7 | use Cloudder; | 
| 10 | 8 | |
| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | public function authenticateUser($user, $provider) | 
| 22 | 22 |      { | 
| 23 | 23 |          if (User::where('provider_id', $user->id)->count() === 0) { | 
| 24 | - $userData = [ | |
| 24 | + $userData = [ | |
| 25 | 25 | 'name' => $user->name, | 
| 26 | 26 | 'username' => $user->nickname, | 
| 27 | 27 | 'email' => $user->email, | 
| @@ -29,9 +29,9 @@ discard block | ||
| 29 | 29 | 'provider_id' => $user->id, | 
| 30 | 30 | 'provider' => $provider, | 
| 31 | 31 | 'about' => $provider === 'twitter' ? $user->user['description'] : '', | 
| 32 | - ]; | |
| 32 | + ]; | |
| 33 | 33 | |
| 34 | - User::create($userData); | |
| 34 | + User::create($userData); | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | 37 |          return User::where('provider_id', $user->id)->first(); | 
| @@ -13,6 +13,7 @@ | ||
| 13 | 13 | /** | 
| 14 | 14 | * Get a single video | 
| 15 | 15 | * | 
| 16 | + * @param integer $id | |
| 16 | 17 | * @return void | 
| 17 | 18 | */ | 
| 18 | 19 | public function getVideo($id) | 
| @@ -100,8 +100,8 @@ | ||
| 100 | 100 | public function unfavoriteVideo($request) | 
| 101 | 101 |      { | 
| 102 | 102 |          Favorite::where('user_id', Auth::user()->id) | 
| 103 | -              ->where('video_id', $request['video_id']) | |
| 104 | - ->delete(); | |
| 103 | +                ->where('video_id', $request['video_id']) | |
| 104 | + ->delete(); | |
| 105 | 105 | |
| 106 | 106 | return [ | 
| 107 | 107 | 'status' => 200, | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | public function getAllComments($videoId) | 
| 41 | 41 |      { | 
| 42 | 42 |          return Comment::where('video_id', $videoId)->get(); | 
| 43 | -        $comments = $comments->each(function ($comment, $key) { | |
| 43 | +        $comments = $comments->each(function($comment, $key) { | |
| 44 | 44 | $comment['user'] = User::find($comment->user_id); | 
| 45 | 45 | }); | 
| 46 | 46 | } | 
| @@ -137,15 +137,15 @@ discard block | ||
| 137 | 137 |      { | 
| 138 | 138 |          $topViewed = Video::orderBy('views', 'DESC')->get()->take($number); | 
| 139 | 139 | |
| 140 | -        $topFavorited = Video::all()->each(function ($video, $key) { | |
| 140 | +        $topFavorited = Video::all()->each(function($video, $key) { | |
| 141 | 141 | $video->favorites = $video->favorites->count(); | 
| 142 | 142 |          })->sortByDesc('favorites')->take($number); | 
| 143 | 143 | |
| 144 | -        $topCommentedOn = Video::all()->each(function ($video, $key) { | |
| 144 | +        $topCommentedOn = Video::all()->each(function($video, $key) { | |
| 145 | 145 | $video->comments = $video->comments->count(); | 
| 146 | 146 |          })->sortByDesc('comments')->take($number); | 
| 147 | 147 | |
| 148 | -        $topUsers = User::all()->each(function ($user, $key) { | |
| 148 | +        $topUsers = User::all()->each(function($user, $key) { | |
| 149 | 149 | $user->videos = $user->videos->count(); | 
| 150 | 150 |          })->sortByDesc('videos')->take(5); | 
| 151 | 151 | |