mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-28 23:57:59 +01:00
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
004c236ed4
commit
d655d0a151
9 changed files with 122 additions and 116 deletions
|
@ -22,7 +22,6 @@ namespace Poniverse\Ponyfm\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Response;
|
|
||||||
|
|
||||||
class DisabledAccountCheck
|
class DisabledAccountCheck
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
namespace Poniverse\Ponyfm\Http\Middleware;
|
namespace Poniverse\Ponyfm\Http\Middleware;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Cache;
|
use Cache;
|
||||||
use Config;
|
use Config;
|
||||||
|
|
|
@ -24,7 +24,6 @@ use Exception;
|
||||||
use Helpers;
|
use Helpers;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Cache;
|
use Cache;
|
||||||
use Poniverse\Ponyfm\Contracts\Searchable;
|
use Poniverse\Ponyfm\Contracts\Searchable;
|
||||||
|
|
|
@ -24,7 +24,6 @@ use Auth;
|
||||||
use Cache;
|
use Cache;
|
||||||
use Config;
|
use Config;
|
||||||
use DB;
|
use DB;
|
||||||
use Elasticsearch;
|
|
||||||
use Poniverse\Ponyfm\Contracts\Searchable;
|
use Poniverse\Ponyfm\Contracts\Searchable;
|
||||||
use Poniverse\Ponyfm\Exceptions\TrackFileNotFoundException;
|
use Poniverse\Ponyfm\Exceptions\TrackFileNotFoundException;
|
||||||
use Poniverse\Ponyfm\Traits\IndexedInElasticsearchTrait;
|
use Poniverse\Ponyfm\Traits\IndexedInElasticsearchTrait;
|
||||||
|
@ -254,6 +253,9 @@ class Track extends Model implements Searchable
|
||||||
$query->join('mlpma_tracks', 'tracks.id', '=', 'mlpma_tracks.track_id');
|
$query->join('mlpma_tracks', 'tracks.id', '=', 'mlpma_tracks.track_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer $count
|
||||||
|
*/
|
||||||
public static function popular($count, $allowExplicit = false)
|
public static function popular($count, $allowExplicit = false)
|
||||||
{
|
{
|
||||||
$trackIds = Cache::remember('popular_tracks'.$count.'-'.($allowExplicit ? 'explicit' : 'safe'), 5,
|
$trackIds = Cache::remember('popular_tracks'.$count.'-'.($allowExplicit ? 'explicit' : 'safe'), 5,
|
||||||
|
@ -658,6 +660,9 @@ class Track extends Model implements Searchable
|
||||||
return "{$this->title}.{$format['extension']}";
|
return "{$this->title}.{$format['extension']}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function getFileFor($format)
|
public function getFileFor($format)
|
||||||
{
|
{
|
||||||
if (!isset(self::$Formats[$format])) {
|
if (!isset(self::$Formats[$format])) {
|
||||||
|
|
|
@ -238,7 +238,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||||
/**
|
/**
|
||||||
* Returns true if this user has the given role.
|
* Returns true if this user has the given role.
|
||||||
*
|
*
|
||||||
* @param $roleName
|
* @param string $roleName
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasRole($roleName)
|
public function hasRole($roleName)
|
||||||
|
|
|
@ -87,6 +87,10 @@ class ProfileRequest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $level
|
||||||
|
* @param string $message
|
||||||
|
*/
|
||||||
public function log($level, $message, $context)
|
public function log($level, $message, $context)
|
||||||
{
|
{
|
||||||
$this->_data['log'][] = [
|
$this->_data['log'][] = [
|
||||||
|
|
Loading…
Reference in a new issue