Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2016-06-06 06:29:37 +00:00
parent 9a9ac7e5a1
commit 3b1b03e12b
43 changed files with 165 additions and 164 deletions

View file

@ -27,7 +27,6 @@ use Poniverse\Ponyfm\Models\Image;
use Poniverse\Ponyfm\Models\Track; use Poniverse\Ponyfm\Models\Track;
use Poniverse\Ponyfm\Models\TrackType; use Poniverse\Ponyfm\Models\TrackType;
use Poniverse\Ponyfm\Models\User; use Poniverse\Ponyfm\Models\User;
use Auth;
use DB; use DB;
class EditTrackCommand extends CommandBase class EditTrackCommand extends CommandBase

View file

@ -30,7 +30,6 @@ use AudioCache;
use File; use File;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use SplFileInfo; use SplFileInfo;
use Validator;
/** /**
* This command is the "second phase" of the upload process - once metadata has * This command is the "second phase" of the upload process - once metadata has

View file

@ -119,7 +119,7 @@ class ParseTrackTagsCommand extends CommandBase
* *
* @param int $artistId * @param int $artistId
* @param string|null $albumName * @param string|null $albumName
* @param null $coverId * @param integer|null $coverId
* @return int|null * @return int|null
*/ */
protected function getAlbumId(int $artistId, $albumName, $coverId = null) { protected function getAlbumId(int $artistId, $albumName, $coverId = null) {

View file

@ -26,7 +26,6 @@ use Poniverse\Ponyfm\Models\Album;
use Poniverse\Ponyfm\Models\Playlist; use Poniverse\Ponyfm\Models\Playlist;
use Poniverse\Ponyfm\Models\Track; use Poniverse\Ponyfm\Models\Track;
use Poniverse\Ponyfm\Models\User; use Poniverse\Ponyfm\Models\User;
use Symfony\Component\Console\Helper\ProgressBar;
class RebuildSearchIndex extends Command class RebuildSearchIndex extends Command
{ {

View file

@ -99,11 +99,13 @@ class TracksController extends ApiControllerBase
return $this->notFound('Track not found!'); return $this->notFound('Track not found!');
} }
if (!$track->canView(Auth::user())) if (!$track->canView(Auth::user())) {
return $this->notFound('Track not found!'); return $this->notFound('Track not found!');
}
if ($track->is_downloadable == false) if ($track->is_downloadable == false) {
return $this->notFound('Track not found!'); return $this->notFound('Track not found!');
}
if (!in_array($format, Track::$CacheableFormats)) { if (!in_array($format, Track::$CacheableFormats)) {
return $this->notFound('Format not found!'); return $this->notFound('Format not found!');

View file

@ -398,6 +398,9 @@ class Album extends Model implements Searchable, Commentable, Favouritable
} }
} }
/**
* @param string $key
*/
public function getCacheKey($key) public function getCacheKey($key)
{ {
return 'album-'.$this->id.'-'.$key; return 'album-'.$this->id.'-'.$key;

View file

@ -24,7 +24,6 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Poniverse\Ponyfm\Contracts\Commentable; use Poniverse\Ponyfm\Contracts\Commentable;
use Poniverse\Ponyfm\Contracts\GeneratesNotifications;
/** /**
* Poniverse\Ponyfm\Models\Comment * Poniverse\Ponyfm\Models\Comment