Merge pull request #89 from Poniverse/scrutinizer-patch-1

Scrutinizer Auto-Fixes
This commit is contained in:
Peter Deltchev 2016-06-05 23:30:26 -07:00
commit b334e51928
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\TrackType;
use Poniverse\Ponyfm\Models\User;
use Auth;
use DB;
class EditTrackCommand extends CommandBase

View file

@ -30,7 +30,6 @@ use AudioCache;
use File;
use Illuminate\Support\Str;
use SplFileInfo;
use Validator;
/**
* 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 string|null $albumName
* @param null $coverId
* @param integer|null $coverId
* @return int|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\Track;
use Poniverse\Ponyfm\Models\User;
use Symfony\Component\Console\Helper\ProgressBar;
class RebuildSearchIndex extends Command
{

View file

@ -99,11 +99,13 @@ class TracksController extends ApiControllerBase
return $this->notFound('Track not found!');
}
if (!$track->canView(Auth::user()))
if (!$track->canView(Auth::user())) {
return $this->notFound('Track not found!');
}
if ($track->is_downloadable == false)
if ($track->is_downloadable == false) {
return $this->notFound('Track not found!');
}
if (!in_array($format, Track::$CacheableFormats)) {
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)
{
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\SoftDeletes;
use Poniverse\Ponyfm\Contracts\Commentable;
use Poniverse\Ponyfm\Contracts\GeneratesNotifications;
/**
* Poniverse\Ponyfm\Models\Comment