From 1d417221bfa2d2b8d49d00b6776db126b4e8de03 Mon Sep 17 00:00:00 2001 From: Phan An Date: Sun, 20 Dec 2015 07:30:28 -0500 Subject: [PATCH] Applied fixes from StyleCI --- app/Http/Controllers/API/LastfmController.php | 2 +- app/Models/Song.php | 6 +++--- app/Models/User.php | 2 +- app/Services/Lastfm.php | 2 +- tests/LastfmTest.php | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/API/LastfmController.php b/app/Http/Controllers/API/LastfmController.php index 2a034a1a..e17f180f 100644 --- a/app/Http/Controllers/API/LastfmController.php +++ b/app/Http/Controllers/API/LastfmController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers\API; +use App\Services\Lastfm; use Illuminate\Contracts\Auth\Guard; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; -use App\Services\Lastfm; class LastfmController extends Controller { diff --git a/app/Models/Song.php b/app/Models/Song.php index 95374ffc..9f3bf0eb 100644 --- a/app/Models/Song.php +++ b/app/Models/Song.php @@ -38,7 +38,7 @@ class Song extends Model * * @return mixed */ - public function scrobble($timestamp) + public function scrobble($timestamp) { // Don't scrobble the unknown guys. No one knows them. if ($this->album->artist->id === Artist::UNKNOWN_ID) { @@ -53,8 +53,8 @@ class Song extends Model } return Lastfm::scrobble( - $this->album->artist->name, - $this->title, + $this->album->artist->name, + $this->title, $timestamp, $this->album->name === Album::UNKNOWN_NAME ? '' : $this->album->name, $sessionKey diff --git a/app/Models/User.php b/app/Models/User.php index ade4ae2b..95288f00 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -85,7 +85,7 @@ AuthenticatableContract, $preferences = $this->preferences; $preferences[$key] = $val; $this->preferences = $preferences; - + $this->save(); } diff --git a/app/Services/Lastfm.php b/app/Services/Lastfm.php index 3fb2fe23..6b330e66 100644 --- a/app/Services/Lastfm.php +++ b/app/Services/Lastfm.php @@ -202,7 +202,7 @@ class Lastfm extends RESTfulService $params['method'] = 'track.scrobble'; try { - return !!$this->post('/', $this->buildAuthCallParams($params), false); + return (bool) $this->post('/', $this->buildAuthCallParams($params), false); } catch (\Exception $e) { Log::error($e); diff --git a/tests/LastfmTest.php b/tests/LastfmTest.php index bae68da2..23fa551e 100644 --- a/tests/LastfmTest.php +++ b/tests/LastfmTest.php @@ -1,15 +1,15 @@ '7f21233b54edea994aa0f23cf55f18a2', ], $api->buildAuthCallParams($params)); - $this->assertEquals('api_key=key&bar=baz&qux=安&api_sig=7f21233b54edea994aa0f23cf55f18a2', + $this->assertEquals('api_key=key&bar=baz&qux=安&api_sig=7f21233b54edea994aa0f23cf55f18a2', $api->buildAuthCallParams($params, true)); }