From 1919df1e20dcdbd4bdeddf1052cd116741f90b1d Mon Sep 17 00:00:00 2001 From: Phan An Date: Wed, 8 Nov 2017 14:11:45 +0100 Subject: [PATCH] Apply fixes from StyleCI (#678) --- app/Console/Commands/SyncMedia.php | 6 +++--- app/Models/File.php | 2 +- app/Models/Interaction.php | 2 +- app/Models/SongZipArchive.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/SyncMedia.php b/app/Console/Commands/SyncMedia.php index 1a70c7d4..26212770 100644 --- a/app/Console/Commands/SyncMedia.php +++ b/app/Console/Commands/SyncMedia.php @@ -115,19 +115,19 @@ class SyncMedia extends Command $this->line("$name has no changes – ignoring"); } - ++$this->ignored; + $this->ignored++; } elseif ($result === File::SYNC_RESULT_BAD_FILE) { if ($this->option('verbose')) { $this->error("$name is not a valid media file because: ".$reason); } - ++$this->invalid; + $this->invalid++; } else { if ($this->option('verbose')) { $this->info("$name synced"); } - ++$this->synced; + $this->synced++; } } diff --git a/app/Models/File.php b/app/Models/File.php index 68cf023f..a679ea88 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -125,7 +125,7 @@ class File 'comments.track_number', ]; - for ($i = 0; $i < count($trackIndices) && $track === 0; ++$i) { + for ($i = 0; $i < count($trackIndices) && $track === 0; $i++) { $track = array_get($info, $trackIndices[$i], [0])[0]; } diff --git a/app/Models/Interaction.php b/app/Models/Interaction.php index 83a7f48e..4265e422 100644 --- a/app/Models/Interaction.php +++ b/app/Models/Interaction.php @@ -65,7 +65,7 @@ class Interaction extends Model $interaction->liked = false; } - ++$interaction->play_count; + $interaction->play_count++; $interaction->save(); }); } diff --git a/app/Models/SongZipArchive.php b/app/Models/SongZipArchive.php index d2300a87..7dcfcbae 100644 --- a/app/Models/SongZipArchive.php +++ b/app/Models/SongZipArchive.php @@ -85,7 +85,7 @@ class SongZipArchive // The following several lines are to make sure each file name is unique. $name = basename($path); if (array_key_exists($name, $this->fileNames)) { - ++$this->fileNames[$name]; + $this->fileNames[$name]++; $parts = explode('.', $name); $ext = $parts[count($parts) - 1]; $parts[count($parts) - 1] = $this->fileNames[$name].".$ext";