mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
Use root namespaces
This commit is contained in:
parent
fe40980f89
commit
8c862cb9cc
5 changed files with 15 additions and 10 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace App;
|
||||
|
||||
use Cache;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Foundation\Application as IlluminateApplication;
|
||||
use InvalidArgumentException;
|
||||
|
@ -93,7 +94,7 @@ class Application extends IlluminateApplication
|
|||
Cache::put('latestKoelVersion', $v, 7 * 24 * 60);
|
||||
|
||||
return $v;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return self::VERSION;
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
|||
|
||||
use App\Models\User;
|
||||
use DB;
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
|
@ -32,7 +33,7 @@ class Init extends Command
|
|||
{
|
||||
try {
|
||||
DB::connection();
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->error('Unable to connect to database.');
|
||||
$this->error('Please fill valid database credentials into .env and rerun this command.');
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
|
||||
|
||||
|
@ -15,7 +16,7 @@ class GetUserFromToken extends BaseMiddleware
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (!$token = $this->auth->setRequest($request)->getToken()) {
|
||||
return $this->respond('tymon.jwt.absent', 'token_not_provided', 400);
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Models;
|
|||
|
||||
use App\Facades\Lastfm;
|
||||
use App\Facades\Util;
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Log;
|
||||
|
||||
|
@ -90,7 +91,7 @@ class Artist extends Model
|
|||
|
||||
$this->update(['image' => $fileName]);
|
||||
$info['image'] = $this->image;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Services;
|
||||
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Log;
|
||||
|
@ -89,7 +90,7 @@ class Lastfm extends RESTfulService
|
|||
'full' => $this->formatText(array_get($artist, 'bio.content')),
|
||||
],
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
@ -145,7 +146,7 @@ class Lastfm extends RESTfulService
|
|||
];
|
||||
}, array_get($album, 'tracks.track', [])),
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
@ -172,7 +173,7 @@ class Lastfm extends RESTfulService
|
|||
$response = $this->get("/?$query", [], false);
|
||||
|
||||
return (string) $response->session->key;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
@ -202,7 +203,7 @@ class Lastfm extends RESTfulService
|
|||
|
||||
try {
|
||||
return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
@ -226,7 +227,7 @@ class Lastfm extends RESTfulService
|
|||
|
||||
try {
|
||||
return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
@ -255,7 +256,7 @@ class Lastfm extends RESTfulService
|
|||
|
||||
try {
|
||||
return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue