From 4b799e85a77c787f573ec93c97e22d523b121e71 Mon Sep 17 00:00:00 2001 From: Phan An Date: Sun, 6 Sep 2020 23:20:42 +0200 Subject: [PATCH] feat: add PHPCSFixer --- .gitignore | 2 + .php_cs.dist | 21 ++ api-docs/source/api-docs/source/config.php | 3 - api-docs/source/config.php | 3 - app/Application.php | 4 +- app/Console/Commands/SyncCommand.php | 8 +- .../Commands/Traits/AskForPassword.php | 2 +- .../SmartPlaylistRuleParameterFactory.php | 4 +- app/Helpers.php | 24 +- .../API/AlbumThumbnailController.php | 1 - app/Http/Controllers/API/AuthController.php | 5 +- app/Http/Controllers/API/DataController.php | 2 +- app/Http/Controllers/API/LastfmController.php | 2 - .../Controllers/API/PlaylistController.php | 3 +- .../Controllers/API/ScrobbleController.php | 2 +- app/Http/Controllers/API/SongController.php | 6 +- app/Http/Kernel.php | 1 - app/Http/Middleware/EncryptCookies.php | 1 - app/Http/Middleware/VerifyCsrfToken.php | 1 - .../API/AbstractMediaImageUpdateRequest.php | 2 +- .../Requests/API/AlbumCoverUpdateRequest.php | 2 +- .../Requests/API/ArtistImageUpdateRequest.php | 2 +- .../Requests/API/LastfmCallbackRequest.php | 2 +- .../API/ObjectStorage/S3/PutSongRequest.php | 4 +- app/Http/Requests/API/SongUpdateRequest.php | 2 +- app/Http/Requests/API/UploadRequest.php | 4 +- app/Http/Requests/API/UserStoreRequest.php | 10 +- app/Http/Requests/API/UserUpdateRequest.php | 10 +- app/Jobs/LoveTrackOnLastfmJob.php | 9 +- app/Jobs/ScrobbleJob.php | 9 +- app/Jobs/UpdateLastfmNowPlayingJob.php | 9 +- .../WatchRecord/InotifyWatchRecord.php | 2 - app/Models/Album.php | 25 +- app/Models/Artist.php | 4 +- app/Models/Interaction.php | 10 +- app/Models/Playlist.php | 1 + app/Models/Rule.php | 8 +- app/Models/Setting.php | 6 +- app/Models/Song.php | 28 +- app/Models/SongZipArchive.php | 2 +- app/Providers/AuthServiceProvider.php | 2 - app/Providers/RouteServiceProvider.php | 1 - app/Services/AbstractApiClient.php | 4 +- app/Services/FileSynchronizer.php | 2 +- app/Services/InteractionService.php | 6 +- app/Services/LastfmService.php | 6 +- app/Services/MediaInformationService.php | 4 +- app/Services/MediaMetadataService.php | 7 +- app/Services/MediaSyncService.php | 2 +- app/Services/UploadService.php | 8 +- app/Traits/SupportsDeleteWhereIDsNotIn.php | 4 +- composer.json | 6 +- composer.lock | 354 +++++++++++++++++- config/apidoc.php | 1 - config/app.php | 4 - config/auth.php | 2 - config/aws.php | 3 +- config/broadcasting.php | 4 - config/cache.php | 10 +- config/compile.php | 4 - config/database.php | 58 ++- config/dotenv-editor.php | 2 - config/filesystems.php | 22 +- config/ide-helper.php | 22 +- config/image.php | 2 - config/koel.php | 2 - config/queue.php | 26 +- config/sanctum.php | 2 - config/services.php | 8 +- config/session.php | 2 - config/view.php | 2 - database/factories/ModelFactory.php | 2 +- .../2015_11_23_074709_create_albums_table.php | 1 - ...7_09_054503_fix_artist_autoindex_value.php | 1 - ...159_copy_artist_to_contributing_artist.php | 1 - ...61504_drop_is_complication_from_albums.php | 1 - ..._11_03_182520_add_rules_into_playlists.php | 4 - resources/lang/en/auth.php | 2 - resources/lang/en/pagination.php | 4 +- resources/lang/en/passwords.php | 2 - resources/lang/en/validation.php | 115 +++--- resources/lang/es/auth.php | 2 - resources/lang/es/pagination.php | 4 +- resources/lang/es/passwords.php | 2 - resources/lang/es/validation.php | 115 +++--- tests/Feature/ArtistImageTest.php | 6 +- tests/Feature/DownloadTest.php | 1 - tests/Feature/SongTest.php | 4 +- tests/Feature/UserTest.php | 4 +- .../Listeners/UpdateLastfmNowPlayingTest.php | 1 - .../Services/MediaMetadataServiceTest.php | 6 +- .../Services/SmartPlaylistServiceTest.php | 2 +- tests/Traits/CreatesApplication.php | 4 +- .../Jobs/UpdateLastfmNowPlayingJobTest.php | 2 +- .../Services/MediaMetadataServiceTest.php | 4 +- 95 files changed, 700 insertions(+), 418 deletions(-) create mode 100644 .php_cs.dist diff --git a/.gitignore b/.gitignore index 83bc0a4b..9f8fcff8 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,5 @@ cypress/videos coverage.xml .phpunit.result.cache log.json + +.php_cs.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 00000000..bb5f6b53 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,21 @@ +exclude('vendor') + ->exclude('storage') + ->exclude('bootstrap/cache') + ->in(__DIR__) +; + +return PhpCsFixer\Config::create() + ->setRules([ + '@Symfony' => true, + 'yoda_style' => [ + 'equal' => false, + 'identical' => false, + 'less_and_greater' => false, + ], + 'phpdoc_summary' => false, + ]) + ->setFinder($finder) +; diff --git a/api-docs/source/api-docs/source/config.php b/api-docs/source/api-docs/source/config.php index 9e791392..fb2a1e92 100644 --- a/api-docs/source/api-docs/source/config.php +++ b/api-docs/source/api-docs/source/config.php @@ -1,7 +1,6 @@ [ - 'type' => 'git', 'repository' => '', @@ -20,6 +18,5 @@ return [ 'branch' => 'gh-pages', 'message' => 'Site updated: '.strftime('%YYYY-%MM-%DD %HH:%mm:%ss'), - ], ]; diff --git a/api-docs/source/config.php b/api-docs/source/config.php index 9e791392..fb2a1e92 100644 --- a/api-docs/source/config.php +++ b/api-docs/source/config.php @@ -1,7 +1,6 @@ [ - 'type' => 'git', 'repository' => '', @@ -20,6 +18,5 @@ return [ 'branch' => 'gh-pages', 'message' => 'Site updated: '.strftime('%YYYY-%MM-%DD %HH:%mm:%ss'), - ], ]; diff --git a/app/Application.php b/app/Application.php index 2b702c45..1bd4fad2 100644 --- a/app/Application.php +++ b/app/Application.php @@ -13,7 +13,7 @@ class Application extends IlluminateApplication /** * Current Koel version. Must start with a v, and is synced with git tags/releases. * - * @link https://github.com/phanan/koel/releases + * @see https://github.com/phanan/koel/releases */ public const KOEL_VERSION = 'v4.4.0'; @@ -57,7 +57,7 @@ class Application extends IlluminateApplication * If this installation of Koel has a CDN_URL configured, use it as the base. * Otherwise, just use a full URL to the asset. * - * @param string $name The additional resource name/path. + * @param string $name the additional resource name/path */ public function staticUrl(?string $name = null): string { diff --git a/app/Console/Commands/SyncCommand.php b/app/Console/Commands/SyncCommand.php index 3f292e95..62312bb4 100644 --- a/app/Console/Commands/SyncCommand.php +++ b/app/Console/Commands/SyncCommand.php @@ -87,7 +87,7 @@ class SyncCommand extends Command * - "CLOSE_WRITE,CLOSE /var/www/media/new.mp3" * - "MOVED_TO /var/www/media/new_dir" * - * @link http://man7.org/linux/man-pages/man1/inotifywait.1.html + * @see http://man7.org/linux/man-pages/man1/inotifywait.1.html * * @throws Exception */ @@ -104,15 +104,15 @@ class SyncCommand extends Command $name = basename($path); if ($result === FileSynchronizer::SYNC_RESULT_UNMODIFIED) { - $this->ignored++; + ++$this->ignored; } elseif ($result === FileSynchronizer::SYNC_RESULT_BAD_FILE) { if ($this->option('verbose')) { $this->error(PHP_EOL."'$name' is not a valid media file: ".$reason); } - $this->invalid++; + ++$this->invalid; } else { - $this->synced++; + ++$this->synced; } } diff --git a/app/Console/Commands/Traits/AskForPassword.php b/app/Console/Commands/Traits/AskForPassword.php index 768b0e02..76154063 100644 --- a/app/Console/Commands/Traits/AskForPassword.php +++ b/app/Console/Commands/Traits/AskForPassword.php @@ -3,7 +3,7 @@ namespace App\Console\Commands\Traits; /** - * @method void error($message, $verbosity = null) + * @method void error($message, $verbosity = null) * @method mixed secret($message, $fallback = true) */ trait AskForPassword diff --git a/app/Factories/SmartPlaylistRuleParameterFactory.php b/app/Factories/SmartPlaylistRuleParameterFactory.php index dd129814..e1fd72a6 100644 --- a/app/Factories/SmartPlaylistRuleParameterFactory.php +++ b/app/Factories/SmartPlaylistRuleParameterFactory.php @@ -22,11 +22,11 @@ class SmartPlaylistRuleParameterFactory Rule::OPERATOR_BEGINS_WITH => [$model, 'LIKE', "{$value[0]}%"], Rule::OPERATOR_ENDS_WITH => [$model, 'LIKE', "%{$value[0]}"], Rule::OPERATOR_IS => [$model, '=', $value[0]], - Rule::OPERATOR_IS_NOT => [$model, '<>', $value[0]], + Rule::OPERATOR_IS_NOT => [$model, '<>', $value[0]], Rule::OPERATOR_CONTAINS => [$model, 'LIKE', "%{$value[0]}%"], Rule::OPERATOR_NOT_CONTAIN => [$model, 'NOT LIKE', "%{$value[0]}%"], Rule::OPERATOR_IS_LESS_THAN => [$model, '<', $value[0]], - Rule::OPERATOR_IS_GREATER_THAN => [$model, '>', $value[0]], + Rule::OPERATOR_IS_GREATER_THAN => [$model, '>', $value[0]], Rule::OPERATOR_IS_BETWEEN => [$model, $value], Rule::OPERATOR_NOT_IN_LAST => static function () use ($model, $value): array { return [$model, '<', (new Carbon())->subDay($value[0])]; diff --git a/app/Helpers.php b/app/Helpers.php index 8ec49385..6b47973d 100644 --- a/app/Helpers.php +++ b/app/Helpers.php @@ -2,26 +2,30 @@ namespace App\Helpers; -function album_cover_path(string $fileName): string { - return public_path(config('koel.album_cover_dir') . $fileName); +function album_cover_path(string $fileName): string +{ + return public_path(config('koel.album_cover_dir').$fileName); } -function album_cover_url(string $fileName): string { - return app()->staticUrl(config('koel.album_cover_dir') . $fileName); +function album_cover_url(string $fileName): string +{ + return app()->staticUrl(config('koel.album_cover_dir').$fileName); } /** * @see album_cover_url() */ -function album_thumbnail_url(string $fileName): string { +function album_thumbnail_url(string $fileName): string +{ return album_cover_url($fileName); } -function artist_image_path(string $fileName): string { - return public_path(config('koel.artist_image_dir') . $fileName); +function artist_image_path(string $fileName): string +{ + return public_path(config('koel.artist_image_dir').$fileName); } -function artist_image_url(string $fileName): string { - return app()->staticUrl(config('koel.artist_image_dir') . $fileName); +function artist_image_url(string $fileName): string +{ + return app()->staticUrl(config('koel.artist_image_dir').$fileName); } - diff --git a/app/Http/Controllers/API/AlbumThumbnailController.php b/app/Http/Controllers/API/AlbumThumbnailController.php index 44bf815e..577199cc 100644 --- a/app/Http/Controllers/API/AlbumThumbnailController.php +++ b/app/Http/Controllers/API/AlbumThumbnailController.php @@ -25,7 +25,6 @@ class AlbumThumbnailController extends Controller * Returns the full URL to the thumbnail or NULL if the album has no cover. * * @response ["thumbnailUrl", "https://localhost/public/img/covers/a146d01afb742b01f28ab8b556f9a75d_thumbnail.jpg"] - * @return JsonResponse */ public function get(Album $album): JsonResponse { diff --git a/app/Http/Controllers/API/AuthController.php b/app/Http/Controllers/API/AuthController.php index 4b142823..4ed1a6fb 100644 --- a/app/Http/Controllers/API/AuthController.php +++ b/app/Http/Controllers/API/AuthController.php @@ -28,8 +28,7 @@ class AuthController extends Controller HashManager $hash, TokenManager $tokenManager, ?Authenticatable $currentUser - ) - { + ) { $this->userRepository = $userRepository; $this->hash = $hash; $this->currentUser = $currentUser; @@ -68,7 +67,7 @@ class AuthController extends Controller } return response()->json([ - 'token' => $this->tokenManager->createToken($user)->plainTextToken + 'token' => $this->tokenManager->createToken($user)->plainTextToken, ]); } diff --git a/app/Http/Controllers/API/DataController.php b/app/Http/Controllers/API/DataController.php index 08b8687f..66ca8239 100644 --- a/app/Http/Controllers/API/DataController.php +++ b/app/Http/Controllers/API/DataController.php @@ -81,7 +81,7 @@ class DataController extends Controller 'useLastfm' => $this->lastfmService->used(), 'useYouTube' => $this->youTubeService->enabled(), 'useiTunes' => $this->iTunesService->used(), - 'allowDownload' => config('koel.download.allow'), + 'allowDownload' => config('koel.download.allow'), 'supportsTranscoding' => config('koel.streaming.ffmpeg_path') && is_executable(config('koel.streaming.ffmpeg_path')), 'cdnUrl' => app()->staticUrl(), diff --git a/app/Http/Controllers/API/LastfmController.php b/app/Http/Controllers/API/LastfmController.php index 5ec3cfe6..b931a0b2 100644 --- a/app/Http/Controllers/API/LastfmController.php +++ b/app/Http/Controllers/API/LastfmController.php @@ -88,8 +88,6 @@ class LastfmController extends Controller * @bodyParam key string required The Last.fm [session key](https://www.last.fm/api/show/auth.getSession). * @response [] * - * @param LastfmSetSessionKeyRequest $request - * * @return JsonResponse */ public function setSessionKey(LastfmSetSessionKeyRequest $request) diff --git a/app/Http/Controllers/API/PlaylistController.php b/app/Http/Controllers/API/PlaylistController.php index 2935abeb..17e27176 100644 --- a/app/Http/Controllers/API/PlaylistController.php +++ b/app/Http/Controllers/API/PlaylistController.php @@ -30,8 +30,7 @@ class PlaylistController extends Controller PlaylistRepository $playlistRepository, SmartPlaylistService $smartPlaylistService, Authenticatable $currentUser - ) - { + ) { $this->playlistRepository = $playlistRepository; $this->smartPlaylistService = $smartPlaylistService; $this->currentUser = $currentUser; diff --git a/app/Http/Controllers/API/ScrobbleController.php b/app/Http/Controllers/API/ScrobbleController.php index e15ec0fc..4f3a198a 100644 --- a/app/Http/Controllers/API/ScrobbleController.php +++ b/app/Http/Controllers/API/ScrobbleController.php @@ -25,7 +25,7 @@ class ScrobbleController extends Controller * * Create a [Last.fm scrobble entry](https://www.last.fm/api/scrobbling) for a song. * - * @param string $timestamp The UNIX timestamp when the song started playing. + * @param string $timestamp the UNIX timestamp when the song started playing * * @return JsonResponse */ diff --git a/app/Http/Controllers/API/SongController.php b/app/Http/Controllers/API/SongController.php index 8a659a2f..1e8a8604 100644 --- a/app/Http/Controllers/API/SongController.php +++ b/app/Http/Controllers/API/SongController.php @@ -45,11 +45,11 @@ class SongController extends Controller * * @queryParam jwt-token required The JWT token. * - * @link https://github.com/phanan/koel/wiki#streaming-music + * @see https://github.com/phanan/koel/wiki#streaming-music * - * @param null|bool $transcode Whether to force transcoding the song. + * @param bool|null $transcode Whether to force transcoding the song. * If this is omitted, by default Koel will transcode FLAC. - * @param null|int $bitRate The target bit rate to transcode, defaults to OUTPUT_BIT_RATE. + * @param int|null $bitRate The target bit rate to transcode, defaults to OUTPUT_BIT_RATE. * Only taken into account if $transcode is truthy. * * @return RedirectResponse|Redirector diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 9707f2c1..b4012a38 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -13,7 +13,6 @@ use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull; use Illuminate\Foundation\Http\Middleware\ValidatePostSize; use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Routing\Middleware\ThrottleRequests; -use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful; class Kernel extends HttpKernel { diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 3aa15f8d..3f13db62 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -12,6 +12,5 @@ class EncryptCookies extends BaseEncrypter * @var array */ protected $except = [ - // ]; } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index a2c35414..0faba9ee 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -12,6 +12,5 @@ class VerifyCsrfToken extends BaseVerifier * @var array */ protected $except = [ - // ]; } diff --git a/app/Http/Requests/API/AbstractMediaImageUpdateRequest.php b/app/Http/Requests/API/AbstractMediaImageUpdateRequest.php index 131caa0f..b9c0f074 100644 --- a/app/Http/Requests/API/AbstractMediaImageUpdateRequest.php +++ b/app/Http/Requests/API/AbstractMediaImageUpdateRequest.php @@ -14,7 +14,7 @@ abstract class AbstractMediaImageUpdateRequest extends Request public function rules(): array { return [ - $this->getImageFieldName() => ['string', 'required', new ImageData()] + $this->getImageFieldName() => ['string', 'required', new ImageData()], ]; } diff --git a/app/Http/Requests/API/AlbumCoverUpdateRequest.php b/app/Http/Requests/API/AlbumCoverUpdateRequest.php index a0ef4c2b..bef6fff4 100644 --- a/app/Http/Requests/API/AlbumCoverUpdateRequest.php +++ b/app/Http/Requests/API/AlbumCoverUpdateRequest.php @@ -2,7 +2,7 @@ namespace App\Http\Requests\API; -/** @property-read string $cover */ +/** @property string $cover */ class AlbumCoverUpdateRequest extends AbstractMediaImageUpdateRequest { protected function getImageFieldName(): string diff --git a/app/Http/Requests/API/ArtistImageUpdateRequest.php b/app/Http/Requests/API/ArtistImageUpdateRequest.php index 04597409..fb9778bb 100644 --- a/app/Http/Requests/API/ArtistImageUpdateRequest.php +++ b/app/Http/Requests/API/ArtistImageUpdateRequest.php @@ -2,7 +2,7 @@ namespace App\Http\Requests\API; -/** @property-read string $image */ +/** @property string $image */ class ArtistImageUpdateRequest extends AbstractMediaImageUpdateRequest { protected function getImageFieldName(): string diff --git a/app/Http/Requests/API/LastfmCallbackRequest.php b/app/Http/Requests/API/LastfmCallbackRequest.php index d6351374..a64ef893 100644 --- a/app/Http/Requests/API/LastfmCallbackRequest.php +++ b/app/Http/Requests/API/LastfmCallbackRequest.php @@ -3,7 +3,7 @@ namespace App\Http\Requests\API; /** - * @property string $token Lastfm's access token + * @property string $token Lastfm's access token * @property string $api_token Koel's current user's token */ class LastfmCallbackRequest extends Request diff --git a/app/Http/Requests/API/ObjectStorage/S3/PutSongRequest.php b/app/Http/Requests/API/ObjectStorage/S3/PutSongRequest.php index 872bb1e7..e236b294 100644 --- a/app/Http/Requests/API/ObjectStorage/S3/PutSongRequest.php +++ b/app/Http/Requests/API/ObjectStorage/S3/PutSongRequest.php @@ -5,9 +5,9 @@ namespace App\Http\Requests\API\ObjectStorage\S3; use App\Http\Requests\API\ObjectStorage\S3\Request as BaseRequest; /** - * @property string $bucket + * @property string $bucket * @property string[] $tags - * @property string $key + * @property string $key */ class PutSongRequest extends BaseRequest { diff --git a/app/Http/Requests/API/SongUpdateRequest.php b/app/Http/Requests/API/SongUpdateRequest.php index 8be4903c..7ba7f244 100644 --- a/app/Http/Requests/API/SongUpdateRequest.php +++ b/app/Http/Requests/API/SongUpdateRequest.php @@ -4,7 +4,7 @@ namespace App\Http\Requests\API; /** * @property string[] $songs - * @property mixed[] $data + * @property mixed[] $data */ class SongUpdateRequest extends Request { diff --git a/app/Http/Requests/API/UploadRequest.php b/app/Http/Requests/API/UploadRequest.php index e18e2dba..b6b67a6f 100644 --- a/app/Http/Requests/API/UploadRequest.php +++ b/app/Http/Requests/API/UploadRequest.php @@ -5,7 +5,7 @@ namespace App\Http\Requests\API; use App\Http\Requests\AbstractRequest; use Illuminate\Http\UploadedFile; -/** @property-read UploadedFile $file */ +/** @property UploadedFile $file */ class UploadRequest extends AbstractRequest { public function authorize(): bool @@ -19,7 +19,7 @@ class UploadRequest extends AbstractRequest 'file' => [ 'required', 'file', - 'mimetypes:audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac' + 'mimetypes:audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac', ], ]; } diff --git a/app/Http/Requests/API/UserStoreRequest.php b/app/Http/Requests/API/UserStoreRequest.php index d0307293..1c681614 100644 --- a/app/Http/Requests/API/UserStoreRequest.php +++ b/app/Http/Requests/API/UserStoreRequest.php @@ -3,10 +3,10 @@ namespace App\Http\Requests\API; /** - * @property-read string $password - * @property-read string $name - * @property-read string $email - * @property-read bool $is_admin + * @property string $password + * @property string $name + * @property string $email + * @property bool $is_admin */ class UserStoreRequest extends Request { @@ -21,7 +21,7 @@ class UserStoreRequest extends Request 'name' => 'required', 'email' => 'required|email|unique:users', 'password' => 'required', - 'is_admin' => 'required' + 'is_admin' => 'required', ]; } } diff --git a/app/Http/Requests/API/UserUpdateRequest.php b/app/Http/Requests/API/UserUpdateRequest.php index 7f67ba03..8daa16db 100644 --- a/app/Http/Requests/API/UserUpdateRequest.php +++ b/app/Http/Requests/API/UserUpdateRequest.php @@ -5,10 +5,10 @@ namespace App\Http\Requests\API; use App\Models\User; /** - * @property-read string $password - * @property-read string $name - * @property-read string $email - * @property-read bool $is_admin + * @property string $password + * @property string $name + * @property string $email + * @property bool $is_admin */ class UserUpdateRequest extends Request { @@ -24,7 +24,7 @@ class UserUpdateRequest extends Request return [ 'name' => 'required', - 'email' => 'required|email|unique:users,email,' . $user->id, + 'email' => 'required|email|unique:users,email,'.$user->id, ]; } } diff --git a/app/Jobs/LoveTrackOnLastfmJob.php b/app/Jobs/LoveTrackOnLastfmJob.php index afdeae20..b3eaaba4 100644 --- a/app/Jobs/LoveTrackOnLastfmJob.php +++ b/app/Jobs/LoveTrackOnLastfmJob.php @@ -6,14 +6,17 @@ use App\Models\Interaction; use App\Models\User; use App\Services\LastfmService; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; class LoveTrackOnLastfmJob implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + use Dispatchable; + use InteractsWithQueue; + use Queueable; + use SerializesModels; private $user; private $interaction; diff --git a/app/Jobs/ScrobbleJob.php b/app/Jobs/ScrobbleJob.php index 1bfa7253..01a05a8d 100644 --- a/app/Jobs/ScrobbleJob.php +++ b/app/Jobs/ScrobbleJob.php @@ -7,14 +7,17 @@ use App\Models\Song; use App\Models\User; use App\Services\LastfmService; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; class ScrobbleJob implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + use Dispatchable; + use InteractsWithQueue; + use Queueable; + use SerializesModels; private $user; private $song; diff --git a/app/Jobs/UpdateLastfmNowPlayingJob.php b/app/Jobs/UpdateLastfmNowPlayingJob.php index 0dbb856e..f6da459b 100644 --- a/app/Jobs/UpdateLastfmNowPlayingJob.php +++ b/app/Jobs/UpdateLastfmNowPlayingJob.php @@ -7,14 +7,17 @@ use App\Models\Song; use App\Models\User; use App\Services\LastfmService; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; class UpdateLastfmNowPlayingJob implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + use Dispatchable; + use InteractsWithQueue; + use Queueable; + use SerializesModels; private $user; private $song; diff --git a/app/Libraries/WatchRecord/InotifyWatchRecord.php b/app/Libraries/WatchRecord/InotifyWatchRecord.php index 8de1d7b0..01d2435c 100644 --- a/app/Libraries/WatchRecord/InotifyWatchRecord.php +++ b/app/Libraries/WatchRecord/InotifyWatchRecord.php @@ -6,8 +6,6 @@ class InotifyWatchRecord extends WatchRecord implements WatchRecordInterface { /** * {@inheritdoc} - * - * @param string $input */ public function __construct(string $input) { diff --git a/app/Models/Album.php b/app/Models/Album.php index 7c26c5e8..c9027b6c 100644 --- a/app/Models/Album.php +++ b/app/Models/Album.php @@ -2,30 +2,29 @@ namespace App\Models; +use function App\Helpers\album_cover_path; +use function App\Helpers\album_cover_url; use App\Traits\SupportsDeleteWhereIDsNotIn; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; -use function App\Helpers\album_cover_path; -use function App\Helpers\album_cover_url; /** - * @property string $cover The album cover's file name - * @property string|null $cover_path The absolute path to the cover file - * @property bool $has_cover If the album has a non-default cover image + * @property string $cover The album cover's file name + * @property string|null $cover_path The absolute path to the cover file + * @property bool $has_cover If the album has a non-default cover image * @property int $id - * @property string $name Name of the album - * @property bool $is_compilation If the album is a compilation from multiple artists - * @property Artist $artist The album's artist + * @property string $name Name of the album + * @property bool $is_compilation If the album is a compilation from multiple artists + * @property Artist $artist The album's artist * @property int $artist_id * @property Collection $songs - * @property bool $is_unknown If the album is the Unknown Album - * @property string|null $thumbnail_name The file name of the album's thumbnail - * @property string|null $thumbnail_path The full path to the thumbnail. Notice that this doesn't guarantee the thumbnail exists. - * @property string|null $thumbnail The public URL to the album's thumbnail - * + * @property bool $is_unknown If the album is the Unknown Album + * @property string|null $thumbnail_name The file name of the album's thumbnail + * @property string|null $thumbnail_path The full path to the thumbnail. Notice that this doesn't guarantee the thumbnail exists. + * @property string|null $thumbnail The public URL to the album's thumbnail * * @method static self firstOrCreate(array $where, array $params = []) * @method static self|null find(int $id) diff --git a/app/Models/Artist.php b/app/Models/Artist.php index 1a9e26dd..17b17d93 100644 --- a/app/Models/Artist.php +++ b/app/Models/Artist.php @@ -3,14 +3,14 @@ namespace App\Models; use App\Facades\Util; +use function App\Helpers\artist_image_path; +use function App\Helpers\artist_image_url; use App\Traits\SupportsDeleteWhereIDsNotIn; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; -use function App\Helpers\artist_image_path; -use function App\Helpers\artist_image_url; /** * @property int $id diff --git a/app/Models/Interaction.php b/app/Models/Interaction.php index b520e833..0f372609 100644 --- a/app/Models/Interaction.php +++ b/app/Models/Interaction.php @@ -7,11 +7,11 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** - * @property bool $liked - * @property int $play_count - * @property Song $song - * @property User $user - * @property int $id + * @property bool $liked + * @property int $play_count + * @property Song $song + * @property User $user + * @property int $id * * @method self firstOrCreate(array $where, array $params = []) */ diff --git a/app/Models/Playlist.php b/app/Models/Playlist.php index fb6341b9..736ff2cc 100644 --- a/app/Models/Playlist.php +++ b/app/Models/Playlist.php @@ -16,6 +16,7 @@ use Illuminate\Support\Collection; * @property bool $is_smart * @property string $name * @property user $user + * * @method static \Illuminate\Database\Eloquent\Collection orderBy(string $field, string $order = 'asc') */ class Playlist extends Model diff --git a/app/Models/Rule.php b/app/Models/Rule.php index c79f7abd..6cf5acb2 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -89,13 +89,7 @@ class Rule private function validateOperator(string $operator): void { if (!in_array($operator, self::VALID_OPERATORS, true)) { - throw new InvalidArgumentException( - sprintf( - '%s is not a valid value for operators. Valid values are: %s', - $operator, - implode(', ', self::VALID_OPERATORS) - ) - ); + throw new InvalidArgumentException(sprintf('%s is not a valid value for operators. Valid values are: %s', $operator, implode(', ', self::VALID_OPERATORS))); } } } diff --git a/app/Models/Setting.php b/app/Models/Setting.php index bd9286ad..5be3ac6f 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -22,8 +22,6 @@ class Setting extends Model /** * Get a setting value. * - * @param string $key - * * @return mixed|string */ public static function get(string $key) @@ -38,8 +36,8 @@ class Setting extends Model /** * Set a setting (no pun) value. * - * @param string|array $key The key of the setting, or an associative array of settings, - * in which case $value will be discarded. + * @param string|array $key the key of the setting, or an associative array of settings, + * in which case $value will be discarded * @param mixed $value */ public static function set($key, $value = null): void diff --git a/app/Models/Song.php b/app/Models/Song.php index 47986b74..ab98b178 100644 --- a/app/Models/Song.php +++ b/app/Models/Song.php @@ -13,19 +13,19 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; /** - * @property string $path - * @property string $title - * @property Album $album - * @property Artist $artist + * @property string $path + * @property string $title + * @property Album $album + * @property Artist $artist * @property string[] $s3_params - * @property float $length - * @property string $lyrics - * @property int $track - * @property int $disc - * @property int $album_id - * @property string $id - * @property int $artist_id - * @property int $mtime + * @property float $length + * @property string $lyrics + * @property int $track + * @property int $disc + * @property int $album_id + * @property string $id + * @property int $artist_id + * @property int $mtime * * @method static self updateOrCreate(array $where, array $params) * @method static Builder select(string $string) @@ -93,13 +93,13 @@ class Song extends Model * Update song info. * * @param string[] $ids - * @param string[] $data The data array, with these supported fields: + * @param string[] $data the data array, with these supported fields: * - title * - artistName * - albumName * - lyrics * All of these are optional, in which case the info will not be changed - * (except for lyrics, which will be emptied). + * (except for lyrics, which will be emptied) */ public static function updateInfo(array $ids, array $data): Collection { diff --git a/app/Models/SongZipArchive.php b/app/Models/SongZipArchive.php index 9263e85c..5d243804 100644 --- a/app/Models/SongZipArchive.php +++ b/app/Models/SongZipArchive.php @@ -92,7 +92,7 @@ class SongZipArchive $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"; diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index bc4d5e5d..e0bb06af 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -26,7 +26,5 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 20cd9bb6..29f3d595 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -35,7 +35,6 @@ class RouteServiceProvider extends ServiceProvider { $this->mapApiRoutes(); $this->mapWebRoutes(); - // } /** diff --git a/app/Services/AbstractApiClient.php b/app/Services/AbstractApiClient.php index 8472f7bd..5fa098ea 100644 --- a/app/Services/AbstractApiClient.php +++ b/app/Services/AbstractApiClient.php @@ -81,7 +81,7 @@ abstract class AbstractApiClient * * @throws InvalidArgumentException * - * @return mixed|null|SimpleXMLElement + * @return mixed|SimpleXMLElement|null */ public function __call(string $method, array $args) { @@ -99,7 +99,7 @@ abstract class AbstractApiClient /** * Turn a URI segment into a full API URL. * - * @param bool $appendKey Whether to automatically append the API key into the URL. + * @param bool $appendKey whether to automatically append the API key into the URL */ public function buildUrl(string $uri, bool $appendKey = true): string { diff --git a/app/Services/FileSynchronizer.php b/app/Services/FileSynchronizer.php index 3e33ddb2..94669340 100644 --- a/app/Services/FileSynchronizer.php +++ b/app/Services/FileSynchronizer.php @@ -314,7 +314,7 @@ class FileSynchronizer 'comments.track_number', ]; - for ($i = 0; $i < count($trackIndices) && $track === 0; $i++) { + for ($i = 0; $i < count($trackIndices) && $track === 0; ++$i) { $track = (int) array_get($info, $trackIndices[$i], [0])[0]; } diff --git a/app/Services/InteractionService.php b/app/Services/InteractionService.php index 0117a9ef..372e5f10 100644 --- a/app/Services/InteractionService.php +++ b/app/Services/InteractionService.php @@ -30,7 +30,7 @@ class InteractionService $interaction->liked = false; } - $interaction->play_count++; + ++$interaction->play_count; $interaction->save(); }); } @@ -38,7 +38,7 @@ class InteractionService /** * Like or unlike a song on behalf of a user. * - * @return Interaction The affected Interaction object. + * @return Interaction the affected Interaction object */ public function toggleLike(string $songId, User $user): Interaction { @@ -58,7 +58,7 @@ class InteractionService * * @param string[] $songIds * - * @return Interaction[] The array of Interaction objects. + * @return Interaction[] the array of Interaction objects */ public function batchLike(array $songIds, User $user): array { diff --git a/app/Services/LastfmService.php b/app/Services/LastfmService.php index 960acdb7..da010f30 100644 --- a/app/Services/LastfmService.php +++ b/app/Services/LastfmService.php @@ -145,7 +145,7 @@ class LastfmService extends AbstractApiClient implements ApiConsumerInterface * * @param string $token The token after successfully connecting to Last.fm * - * @link http://www.last.fm/api/webauth#4 + * @see http://www.last.fm/api/webauth#4 */ public function getSessionKey(string $token): ?string { @@ -240,9 +240,9 @@ class LastfmService extends AbstractApiClient implements ApiConsumerInterface * - The API key (api_key) * - The API signature (api_sig). * - * @link http://www.last.fm/api/webauth#5 + * @see http://www.last.fm/api/webauth#5 * - * @param array $params The array of parameters. + * @param array $params the array of parameters * @param bool $toString Whether to turn the array into a query string * * @return array|string diff --git a/app/Services/MediaInformationService.php b/app/Services/MediaInformationService.php index 3d425107..a612bfdc 100644 --- a/app/Services/MediaInformationService.php +++ b/app/Services/MediaInformationService.php @@ -19,7 +19,7 @@ class MediaInformationService /** * Get extra information about an album from Last.fm. * - * @return array|null The album info in an array format, or null on failure. + * @return array|null the album info in an array format, or null on failure */ public function getAlbumInformation(Album $album): ?array { @@ -43,7 +43,7 @@ class MediaInformationService /** * Get extra information about an artist from Last.fm. * - * @return array|null The artist info in an array format, or null on failure. + * @return array|null the artist info in an array format, or null on failure */ public function getArtistInformation(Artist $artist): ?array { diff --git a/app/Services/MediaMetadataService.php b/app/Services/MediaMetadataService.php index cc008617..da7c8f9b 100644 --- a/app/Services/MediaMetadataService.php +++ b/app/Services/MediaMetadataService.php @@ -2,12 +2,12 @@ namespace App\Services; +use function App\Helpers\album_cover_path; +use function App\Helpers\artist_image_path; use App\Models\Album; use App\Models\Artist; use Exception; use Psr\Log\LoggerInterface; -use function App\Helpers\album_cover_path; -use function App\Helpers\artist_image_path; class MediaMetadataService { @@ -40,8 +40,7 @@ class MediaMetadataService string $extension, string $destination = '', bool $cleanUp = true - ): void - { + ): void { try { $extension = trim(strtolower($extension), '. '); $destination = $destination ?: $this->generateAlbumCoverPath($extension); diff --git a/app/Services/MediaSyncService.php b/app/Services/MediaSyncService.php index e4972bea..9a734076 100644 --- a/app/Services/MediaSyncService.php +++ b/app/Services/MediaSyncService.php @@ -85,7 +85,7 @@ class MediaSyncService * Only taken into account for existing records. * New records will have all tags synced in regardless. * @param bool $force Whether to force syncing even unchanged files - * @param SyncCommand $syncCommand The SyncMedia command object, to log to console if executed by artisan. + * @param SyncCommand $syncCommand the SyncMedia command object, to log to console if executed by artisan * * @throws Exception */ diff --git a/app/Services/UploadService.php b/app/Services/UploadService.php index 77ae3db2..888b4f7a 100644 --- a/app/Services/UploadService.php +++ b/app/Services/UploadService.php @@ -28,7 +28,7 @@ class UploadService $targetFileName = $this->getTargetFileName($file); $file->move($this->getUploadDirectory(), $targetFileName); - $targetPathName = $this->getUploadDirectory() . $targetFileName; + $targetPathName = $this->getUploadDirectory().$targetFileName; $this->fileSynchronizer->setFile($targetPathName); $result = $this->fileSynchronizer->sync(MediaSyncService::APPLICABLE_TAGS); @@ -54,7 +54,7 @@ class UploadService throw new MediaPathNotSetException(); } - $uploadDirectory = $mediaPath . DIRECTORY_SEPARATOR . self::UPLOAD_DIRECTORY . DIRECTORY_SEPARATOR; + $uploadDirectory = $mediaPath.DIRECTORY_SEPARATOR.self::UPLOAD_DIRECTORY.DIRECTORY_SEPARATOR; } return $uploadDirectory; @@ -68,11 +68,11 @@ class UploadService // If there's no existing file with the same name in the upload directory, use the original name. // Otherwise, prefix the original name with a hash. // The whole point is to keep a readable file name when we can. - if (!file_exists($this->getUploadDirectory() . $file->getClientOriginalName())) { + if (!file_exists($this->getUploadDirectory().$file->getClientOriginalName())) { return $file->getClientOriginalName(); } - return $this->getUniqueHash() . '_' . $file->getClientOriginalName(); + return $this->getUniqueHash().'_'.$file->getClientOriginalName(); } private function getUniqueHash(): string diff --git a/app/Traits/SupportsDeleteWhereIDsNotIn.php b/app/Traits/SupportsDeleteWhereIDsNotIn.php index 44e5f11d..e36fd113 100644 --- a/app/Traits/SupportsDeleteWhereIDsNotIn.php +++ b/app/Traits/SupportsDeleteWhereIDsNotIn.php @@ -20,8 +20,8 @@ trait SupportsDeleteWhereIDsNotIn /** * Deletes all records whose IDs are not in an array. * - * @param string[]|int[] $ids The array of IDs. - * @param string $key Name of the primary key. + * @param string[]|int[] $ids the array of IDs + * @param string $key name of the primary key * * @throws Exception */ diff --git a/composer.json b/composer.json index 9f788419..0a4f6131 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ "laravel/browser-kit-testing": "^6.0", "mikey179/vfsstream": "^1.6", "php-mock/php-mock-mockery": "^1.3", - "mpociot/laravel-apidoc-generator": "^4.1" + "mpociot/laravel-apidoc-generator": "^4.1", + "friendsofphp/php-cs-fixer": "^2.16" }, "suggest": { "ext-zip": "Allow downloading multiple songs as Zip archives" @@ -84,7 +85,8 @@ "test": "phpunit --colors=always --order-by=defects", "coverage": "phpunit --colors=always --coverage-clover=coverage.xml", "analyze": "phpstan analyse app --level=5", - "gen-api-docs": "@php artisan apidoc:generate" + "gen-api-docs": "@php artisan apidoc:generate", + "cs:fix": "php-cs-fixer fix --config .php_cs.dist --allow-risky=yes" }, "config": { "preferred-install": "dist", diff --git a/composer.lock b/composer.lock index 40c0bde0..2dda66ce 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7adfb74c8048cbbdd4859557d8b8dacb", + "content-hash": "ed3b206b517c10e1b64a5beea11556d6", "packages": [ { "name": "aws/aws-sdk-php", @@ -5736,6 +5736,76 @@ "description": "implementation of xdg base directory specification for php", "time": "2019-12-04T15:06:13+00:00" }, + { + "name": "doctrine/annotations", + "version": "1.10.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "bfe91e31984e2ba76df1c1339681770401ec262f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/bfe91e31984e2ba76df1c1339681770401ec262f", + "reference": "bfe91e31984e2ba76df1c1339681770401ec262f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^9.1.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2020-08-10T19:35:50+00:00" + }, { "name": "doctrine/instantiator", "version": "1.3.1", @@ -6028,6 +6098,103 @@ ], "time": "2020-06-14T09:00:00+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.16.4", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "1023c3458137ab052f6ff1e09621a721bfdeca13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1023c3458137ab052f6ff1e09621a721bfdeca13", + "reference": "1023c3458137ab052f6ff1e09621a721bfdeca13", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.2", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.2", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.1", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpunitgoodpractices/traits": "^1.8", + "symfony/phpunit-bridge": "^5.1", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2020-06-27T23:57:46+00:00" + }, { "name": "fzaninotto/faker", "version": "v1.9.1", @@ -6975,6 +7142,57 @@ "description": "Library for handling version information and constraints", "time": "2018-07-08T19:19:57+00:00" }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "time": "2018-02-15T16:58:55+00:00" + }, { "name": "php-di/invoker", "version": "2.1.0", @@ -8675,6 +8893,140 @@ ], "time": "2020-08-21T17:19:47+00:00" }, + { + "name": "symfony/options-resolver", + "version": "v5.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "9ff59517938f88d90b6e65311fef08faa640f681" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/9ff59517938f88d90b6e65311fef08faa640f681", + "reference": "9ff59517938f88d90b6e65311fef08faa640f681", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-12T12:58:00+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "0f7c58cf81dbb5dd67d423a89d577524a2ec0323" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0f7c58cf81dbb5dd67d423a89d577524a2ec0323", + "reference": "0f7c58cf81dbb5dd67d423a89d577524a2ec0323", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1.0|^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-05-20T17:43:50+00:00" + }, { "name": "symfony/var-exporter", "version": "v5.1.5", diff --git a/config/apidoc.php b/config/apidoc.php index f143db2e..e785ccc1 100644 --- a/config/apidoc.php +++ b/config/apidoc.php @@ -37,7 +37,6 @@ return [ * A route must fulfill ALL conditions to pass. */ 'match' => [ - /* * Match only routes whose domains match this pattern (use * as a wildcard to match any characters). */ diff --git a/config/app.php b/config/app.php index 775dcf36..dac3e02e 100644 --- a/config/app.php +++ b/config/app.php @@ -98,7 +98,6 @@ return [ */ 'providers' => [ - /* * Laravel Framework Service Providers... */ @@ -157,7 +156,6 @@ return [ */ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, @@ -197,7 +195,5 @@ return [ 'Download' => App\Facades\Download::class, 'AWS' => Aws\Laravel\AwsFacade::class, 'iTunes' => App\Facades\iTunes::class, - ], - ]; diff --git a/config/auth.php b/config/auth.php index 9fb660c5..fb421265 100644 --- a/config/auth.php +++ b/config/auth.php @@ -1,7 +1,6 @@ 60, ], ], - ]; diff --git a/config/aws.php b/config/aws.php index 684e91ab..64ef661e 100644 --- a/config/aws.php +++ b/config/aws.php @@ -3,7 +3,6 @@ use Aws\Laravel\AwsServiceProvider; return [ - /* |-------------------------------------------------------------------------- | AWS SDK Configuration @@ -17,7 +16,7 @@ return [ | */ 'credentials' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 3bc2270c..6b9a0a49 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -1,7 +1,6 @@ [ - 'pusher' => [ 'driver' => 'pusher', 'key' => env('PUSHER_APP_KEY'), @@ -46,7 +44,5 @@ return [ 'log' => [ 'driver' => 'log', ], - ], - ]; diff --git a/config/cache.php b/config/cache.php index 8159bc8d..6fd18d6a 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,7 +1,6 @@ [ - 'apc' => [ 'driver' => 'apc', ], @@ -38,17 +36,17 @@ return [ 'database' => [ 'driver' => 'database', - 'table' => 'cache', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'servers' => [ [ 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100, @@ -60,7 +58,6 @@ return [ 'driver' => 'redis', 'connection' => 'default', ], - ], /* @@ -75,5 +72,4 @@ return [ */ 'prefix' => 'laravel', - ]; diff --git a/config/compile.php b/config/compile.php index 04807eac..cbf7739a 100644 --- a/config/compile.php +++ b/config/compile.php @@ -1,7 +1,6 @@ [ - // ], /* @@ -29,7 +27,5 @@ return [ */ 'providers' => [ - // ], - ]; diff --git a/config/database.php b/config/database.php index f0cd2403..874de3ce 100644 --- a/config/database.php +++ b/config/database.php @@ -1,7 +1,6 @@ [ - 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => ':memory:', - 'prefix' => '', + 'prefix' => '', ], 'sqlite-e2e' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', __DIR__.'/../database/e2e.sqlite'), - 'prefix' => '', + 'prefix' => '', ], 'sqlite-persistent' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', __DIR__.'/../database/koel.sqlite'), - 'prefix' => '', + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', 3306), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8mb4', + 'driver' => 'mysql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 3306), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'strict' => false, + 'prefix' => '', + 'strict' => false, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', 5432), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 5432), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', 1433), + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 1433), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'charset' => 'utf8', + 'prefix' => '', ], - ], /* @@ -114,7 +111,6 @@ return [ */ 'redis' => [ - 'client' => 'predis', 'options' => [ @@ -131,7 +127,5 @@ return [ ], ], ], - ], - ]; diff --git a/config/dotenv-editor.php b/config/dotenv-editor.php index fb7ea4e3..2b46f971 100644 --- a/config/dotenv-editor.php +++ b/config/dotenv-editor.php @@ -1,7 +1,6 @@ base_path('storage/dotenv-editor/backups/'), - ]; diff --git a/config/filesystems.php b/config/filesystems.php index 0bb45ce6..9f4aa101 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -1,7 +1,6 @@ [ - 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'ftp' => [ - 'driver' => 'ftp', - 'host' => 'ftp.example.com', + 'driver' => 'ftp', + 'host' => 'ftp.example.com', 'username' => 'your-username', 'password' => 'your-password', @@ -71,15 +69,13 @@ return [ ], 'rackspace' => [ - 'driver' => 'rackspace', - 'username' => 'your-username', - 'key' => 'your-key', + 'driver' => 'rackspace', + 'username' => 'your-username', + 'key' => 'your-key', 'container' => 'your-container', - 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', - 'region' => 'IAD', - 'url_type' => 'publicURL', + 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', + 'region' => 'IAD', + 'url_type' => 'publicURL', ], - ], - ]; diff --git a/config/ide-helper.php b/config/ide-helper.php index 66bc45fe..77b7e6f4 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -1,7 +1,6 @@ '_ide_helper', - 'format' => 'php', + 'filename' => '_ide_helper', + 'format' => 'php', /* |-------------------------------------------------------------------------- @@ -60,13 +59,13 @@ return [ 'magic' => [ 'Log' => [ - 'debug' => 'Monolog\Logger::addDebug', - 'info' => 'Monolog\Logger::addInfo', - 'notice' => 'Monolog\Logger::addNotice', - 'warning' => 'Monolog\Logger::addWarning', - 'error' => 'Monolog\Logger::addError', - 'critical' => 'Monolog\Logger::addCritical', - 'alert' => 'Monolog\Logger::addAlert', + 'debug' => 'Monolog\Logger::addDebug', + 'info' => 'Monolog\Logger::addInfo', + 'notice' => 'Monolog\Logger::addNotice', + 'warning' => 'Monolog\Logger::addWarning', + 'error' => 'Monolog\Logger::addError', + 'critical' => 'Monolog\Logger::addCritical', + 'alert' => 'Monolog\Logger::addAlert', 'emergency' => 'Monolog\Logger::addEmergency', ], ], @@ -82,7 +81,6 @@ return [ */ 'interfaces' => [ - ], /* @@ -112,7 +110,5 @@ return [ | */ 'custom_db_types' => [ - ], - ]; diff --git a/config/image.php b/config/image.php index be14e33a..a86d0699 100644 --- a/config/image.php +++ b/config/image.php @@ -1,7 +1,6 @@ extension_loaded('imagick') ? 'imagick' : 'gd', - ]; diff --git a/config/koel.php b/config/koel.php index a6973b0f..fbcac0e3 100644 --- a/config/koel.php +++ b/config/koel.php @@ -1,7 +1,6 @@ 'https://opencollective.com/koel', 'demo' => env('KOEL_DEMO', false), ], - ]; diff --git a/config/queue.php b/config/queue.php index 0e895f2c..cb9a0dd5 100644 --- a/config/queue.php +++ b/config/queue.php @@ -1,7 +1,6 @@ [ - 'sync' => [ 'driver' => 'sync', ], 'database' => [ 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'table' => 'jobs', + 'queue' => 'default', 'expire' => 60, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, + 'host' => 'localhost', + 'queue' => 'default', + 'ttr' => 60, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => env('SQS_PUBLIC_KEY'), + 'key' => env('SQS_PUBLIC_KEY'), 'secret' => env('SQS_SECRET_KEY'), 'prefix' => env('SQS_QUEUE_PREFIX'), - 'queue' => env('SQL_QUEUE_NAME'), + 'queue' => env('SQL_QUEUE_NAME'), 'region' => env('SQS_QUEUE_REGION'), ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', - 'expire' => 60, + 'queue' => 'default', + 'expire' => 60, ], - ], /* @@ -80,7 +77,6 @@ return [ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], - ]; diff --git a/config/sanctum.php b/config/sanctum.php index f0ac415f..9cea54e3 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -1,7 +1,6 @@ [ ], - ]; diff --git a/config/services.php b/config/services.php index 22032cf5..fbea4f03 100644 --- a/config/services.php +++ b/config/services.php @@ -1,7 +1,6 @@ [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], 'stripe' => [ - 'model' => App\Models\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => App\Models\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], - ]; diff --git a/config/session.php b/config/session.php index c62f8d4e..958ab600 100644 --- a/config/session.php +++ b/config/session.php @@ -1,7 +1,6 @@ false, - ]; diff --git a/config/view.php b/config/view.php index e193ab61..4d88d5d5 100644 --- a/config/view.php +++ b/config/view.php @@ -1,7 +1,6 @@ realpath(storage_path('framework/views')), - ]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 0acd4495..6f37b142 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -11,7 +11,7 @@ use Faker\Generator as Faker; use Illuminate\Database\Eloquent\Factory; use Illuminate\Support\Facades\Hash; -/** @var Factory $factory */ +/* @var Factory $factory */ $factory->define(User::class, function ($faker) { return [ 'name' => $faker->name, diff --git a/database/migrations/2015_11_23_074709_create_albums_table.php b/database/migrations/2015_11_23_074709_create_albums_table.php index 113c5ba6..2413abcb 100644 --- a/database/migrations/2015_11_23_074709_create_albums_table.php +++ b/database/migrations/2015_11_23_074709_create_albums_table.php @@ -2,7 +2,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; class CreateAlbumsTable extends Migration diff --git a/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php b/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php index 220ee186..fa2c8bbb 100644 --- a/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php +++ b/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php @@ -30,6 +30,5 @@ class FixArtistAutoindexValue extends Migration */ public function down() { - // } } diff --git a/database/migrations/2017_04_21_092159_copy_artist_to_contributing_artist.php b/database/migrations/2017_04_21_092159_copy_artist_to_contributing_artist.php index 84662760..d4f20304 100644 --- a/database/migrations/2017_04_21_092159_copy_artist_to_contributing_artist.php +++ b/database/migrations/2017_04_21_092159_copy_artist_to_contributing_artist.php @@ -27,6 +27,5 @@ class CopyArtistToContributingArtist extends Migration */ public function down() { - // } } diff --git a/database/migrations/2017_04_22_161504_drop_is_complication_from_albums.php b/database/migrations/2017_04_22_161504_drop_is_complication_from_albums.php index 147f00c6..cebfdb95 100644 --- a/database/migrations/2017_04_22_161504_drop_is_complication_from_albums.php +++ b/database/migrations/2017_04_22_161504_drop_is_complication_from_albums.php @@ -25,6 +25,5 @@ class DropIsComplicationFromAlbums extends Migration */ public function down() { - // } } diff --git a/database/migrations/2018_11_03_182520_add_rules_into_playlists.php b/database/migrations/2018_11_03_182520_add_rules_into_playlists.php index 7d204b2a..7c6924b1 100644 --- a/database/migrations/2018_11_03_182520_add_rules_into_playlists.php +++ b/database/migrations/2018_11_03_182520_add_rules_into_playlists.php @@ -8,8 +8,6 @@ class AddRulesIntoPlaylists extends Migration { /** * Run the migrations. - * - * @return void */ public function up(): void { @@ -20,8 +18,6 @@ class AddRulesIntoPlaylists extends Migration /** * Reverse the migrations. - * - * @return void */ public function down(): void { diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df2..abc73445 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -1,7 +1,6 @@ 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - ]; diff --git a/resources/lang/en/pagination.php b/resources/lang/en/pagination.php index fcab34b2..ecac3aa3 100644 --- a/resources/lang/en/pagination.php +++ b/resources/lang/en/pagination.php @@ -1,7 +1,6 @@ '« Previous', - 'next' => 'Next »', - + 'next' => 'Next »', ]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e6f3a671..c6c49b7b 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -1,7 +1,6 @@ 'We have e-mailed your password reset link!', 'token' => 'This password reset token is invalid.', 'user' => "We can't find a user with that e-mail address.", - ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index ddcd6545..ea5914d3 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -1,7 +1,6 @@ 'The :attribute must be accepted.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'between' => [ + 'accepted' => 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'between' => [ 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'email' => 'The :attribute must be a valid email address.', - 'exists' => 'The selected :attribute is invalid.', - 'filled' => 'The :attribute field is required.', - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'max' => [ + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'email' => 'The :attribute must be a valid email address.', + 'exists' => 'The selected :attribute is invalid.', + 'filled' => 'The :attribute field is required.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'max' => [ 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', ], - 'mimes' => 'The :attribute must be a file of type: :values.', - 'min' => [ + 'mimes' => 'The :attribute must be a file of type: :values.', + 'min' => [ 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', ], - 'not_in' => 'The selected :attribute is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values is present.', - 'required_without' => 'The :attribute field is required when :values is not present.', + 'not_in' => 'The selected :attribute is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ + 'same' => 'The :attribute and :other must match.', + 'size' => [ 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', ], - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid zone.', - 'unique' => 'The :attribute has already been taken.', - 'url' => 'The :attribute format is invalid.', + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'url' => 'The :attribute format is invalid.', - 'path' => [ - 'valid' => 'The :attribute is not a valid or readable path.', + 'path' => [ + 'valid' => 'The :attribute is not a valid or readable path.', ], /* @@ -93,7 +92,6 @@ return [ */ 'custom' => [ - ], /* @@ -108,5 +106,4 @@ return [ */ 'attributes' => [], - ]; diff --git a/resources/lang/es/auth.php b/resources/lang/es/auth.php index 3fdb7718..98b2bb07 100644 --- a/resources/lang/es/auth.php +++ b/resources/lang/es/auth.php @@ -1,7 +1,6 @@ 'Estas credenciales no coinciden con nuestros registros.', 'throttle' => 'Demasiados intentos de inicio de sesión. Por favor intente de nuevo en :seconds segundos.', - ]; diff --git a/resources/lang/es/pagination.php b/resources/lang/es/pagination.php index 325916dc..51862f2e 100644 --- a/resources/lang/es/pagination.php +++ b/resources/lang/es/pagination.php @@ -1,7 +1,6 @@ '« Anterior', - 'next' => 'Siguiente »', - + 'next' => 'Siguiente »', ]; diff --git a/resources/lang/es/passwords.php b/resources/lang/es/passwords.php index 89be8106..7a353e7c 100644 --- a/resources/lang/es/passwords.php +++ b/resources/lang/es/passwords.php @@ -1,7 +1,6 @@ '¡Hemos enviado por correo electrónico el enlace para reestablecer contraseña!', 'token' => 'Este token de reestablecimiento de contraseña no es válido.', 'user' => 'No podemos encontrar un usuario con ese correo electrónico.', - ]; diff --git a/resources/lang/es/validation.php b/resources/lang/es/validation.php index c381a5c4..779f2b54 100644 --- a/resources/lang/es/validation.php +++ b/resources/lang/es/validation.php @@ -1,7 +1,6 @@ 'El :attribute debe ser aceptado.', - 'active_url' => 'El :attribute no es una URL válida.', - 'after' => 'El :attribute debe ser una fecha posterior a :date.', - 'alpha' => 'El :attribute solo puede contener letras.', - 'alpha_dash' => 'El :attribute solo puede contener letras, números y guiones.', - 'alpha_num' => 'El :attribute solo puede contener letras y números.', - 'array' => 'El :attribute debe ser un arreglo.', - 'before' => 'El :attribute debe ser una fecha anterior a :date.', - 'between' => [ + 'accepted' => 'El :attribute debe ser aceptado.', + 'active_url' => 'El :attribute no es una URL válida.', + 'after' => 'El :attribute debe ser una fecha posterior a :date.', + 'alpha' => 'El :attribute solo puede contener letras.', + 'alpha_dash' => 'El :attribute solo puede contener letras, números y guiones.', + 'alpha_num' => 'El :attribute solo puede contener letras y números.', + 'array' => 'El :attribute debe ser un arreglo.', + 'before' => 'El :attribute debe ser una fecha anterior a :date.', + 'between' => [ 'numeric' => 'El :attribute debe estar entre :min y :max.', - 'file' => 'El :attribute debe estar entre :min y :max kilobytes.', - 'string' => 'El :attribute must be between :min y :max caracteres.', - 'array' => 'El :attribute debe tener entre :min y :max elementos.', + 'file' => 'El :attribute debe estar entre :min y :max kilobytes.', + 'string' => 'El :attribute must be between :min y :max caracteres.', + 'array' => 'El :attribute debe tener entre :min y :max elementos.', ], - 'boolean' => 'El campo :attribute debe ser verdadero o falso.', - 'confirmed' => 'El :attribute confirmación no coincide.', - 'date' => 'El :attribute no es una fecha válida.', - 'date_format' => 'El :attribute no coincide con el formato :format.', - 'different' => 'El :attribute y :other deben ser diferentes.', - 'digits' => 'El :attribute debe ser de :digits dígitos.', - 'digits_between' => 'El :attribute debe estar entre :min y :max dígitos.', - 'email' => 'El :attribute debe ser un correo electrónico válido.', - 'exists' => 'El :attribute seleccionado no es válido.', - 'filled' => 'El campo :attribute es requerido.', - 'image' => 'El :attribute debe ser una imagen.', - 'in' => 'El :attribute seleccionado no es válido.', - 'integer' => 'El :attribute debe ser un entero.', - 'ip' => 'El :attribute debe ser una dirección IP válida.', - 'json' => 'El :attribute debe ser una cadena JSON válida.', - 'max' => [ + 'boolean' => 'El campo :attribute debe ser verdadero o falso.', + 'confirmed' => 'El :attribute confirmación no coincide.', + 'date' => 'El :attribute no es una fecha válida.', + 'date_format' => 'El :attribute no coincide con el formato :format.', + 'different' => 'El :attribute y :other deben ser diferentes.', + 'digits' => 'El :attribute debe ser de :digits dígitos.', + 'digits_between' => 'El :attribute debe estar entre :min y :max dígitos.', + 'email' => 'El :attribute debe ser un correo electrónico válido.', + 'exists' => 'El :attribute seleccionado no es válido.', + 'filled' => 'El campo :attribute es requerido.', + 'image' => 'El :attribute debe ser una imagen.', + 'in' => 'El :attribute seleccionado no es válido.', + 'integer' => 'El :attribute debe ser un entero.', + 'ip' => 'El :attribute debe ser una dirección IP válida.', + 'json' => 'El :attribute debe ser una cadena JSON válida.', + 'max' => [ 'numeric' => 'El :attribute no puede ser mayor que :max.', - 'file' => 'El :attribute no puede ser mayor que :max kilobytes.', - 'string' => 'El :attribute no puede ser mayor que :max caracteres.', - 'array' => 'El :attribute no puede tener mas de :max elementos.', + 'file' => 'El :attribute no puede ser mayor que :max kilobytes.', + 'string' => 'El :attribute no puede ser mayor que :max caracteres.', + 'array' => 'El :attribute no puede tener mas de :max elementos.', ], - 'mimes' => 'El :attribute debe ser un archivo de tipo: :values.', - 'min' => [ + 'mimes' => 'El :attribute debe ser un archivo de tipo: :values.', + 'min' => [ 'numeric' => 'El :attribute debe ser al menos de :min.', - 'file' => 'El :attribute debe ser al menos de :min kilobytes.', - 'string' => 'El :attribute debe ser al menos de :min caracteres.', - 'array' => 'El :attribute debe tener al menos :min elementos.', + 'file' => 'El :attribute debe ser al menos de :min kilobytes.', + 'string' => 'El :attribute debe ser al menos de :min caracteres.', + 'array' => 'El :attribute debe tener al menos :min elementos.', ], - 'not_in' => 'El :attribute seleccionado no es válido.', - 'numeric' => 'El :attribute debe ser numérico.', - 'regex' => 'El formato de :attribute no es válido.', - 'required' => 'El campo :attribute es requerido.', - 'required_if' => 'El campo :attribute es requerido cuando :other es :value.', - 'required_unless' => 'El campo :attribute es requerido a menos que :other exista en :values.', - 'required_with' => 'El campo :attribute es requerido cuando :values está presente.', - 'required_with_all' => 'El campo :attribute es requerido cuando :values está presente.', - 'required_without' => 'El campo :attribute es requerido cuando :values no está presente.', + 'not_in' => 'El :attribute seleccionado no es válido.', + 'numeric' => 'El :attribute debe ser numérico.', + 'regex' => 'El formato de :attribute no es válido.', + 'required' => 'El campo :attribute es requerido.', + 'required_if' => 'El campo :attribute es requerido cuando :other es :value.', + 'required_unless' => 'El campo :attribute es requerido a menos que :other exista en :values.', + 'required_with' => 'El campo :attribute es requerido cuando :values está presente.', + 'required_with_all' => 'El campo :attribute es requerido cuando :values está presente.', + 'required_without' => 'El campo :attribute es requerido cuando :values no está presente.', 'required_without_all' => 'El campo :attribute es requerido cuando ninguno de :values están presentes.', - 'same' => 'El :attribute y :other deben coincidir.', - 'size' => [ + 'same' => 'El :attribute y :other deben coincidir.', + 'size' => [ 'numeric' => 'El :attribute debe ser de :size.', - 'file' => 'El :attribute debe ser de :size kilobytes.', - 'string' => 'El :attribute debe ser de :size caracteres.', - 'array' => 'El :attribute debe contener :size elementos.', + 'file' => 'El :attribute debe ser de :size kilobytes.', + 'string' => 'El :attribute debe ser de :size caracteres.', + 'array' => 'El :attribute debe contener :size elementos.', ], - 'string' => 'El :attribute debe ser una cadena.', - 'timezone' => 'El :attribute debe ser una zona válida.', - 'unique' => 'El :attribute ya ha sido tomado.', - 'url' => 'El formato de :attribute no es válido.', + 'string' => 'El :attribute debe ser una cadena.', + 'timezone' => 'El :attribute debe ser una zona válida.', + 'unique' => 'El :attribute ya ha sido tomado.', + 'url' => 'El formato de :attribute no es válido.', - 'path' => [ - 'valid' => 'El :attribute no es una ruta válida o legible.', + 'path' => [ + 'valid' => 'El :attribute no es una ruta válida o legible.', ], /* @@ -93,7 +92,6 @@ return [ */ 'custom' => [ - ], /* @@ -108,5 +106,4 @@ return [ */ 'attributes' => [], - ]; diff --git a/tests/Feature/ArtistImageTest.php b/tests/Feature/ArtistImageTest.php index 15940fa4..d51c453c 100644 --- a/tests/Feature/ArtistImageTest.php +++ b/tests/Feature/ArtistImageTest.php @@ -29,11 +29,11 @@ class ArtistImageTest extends TestCase ->shouldReceive('writeArtistImage') ->once() ->with(Mockery::on(static function (Artist $artist): bool { - return $artist->id === 9999; + return $artist->id === 9999; }), 'Foo', 'jpeg'); $this->putAsUser('api/artist/9999/image', [ - 'image' => 'data:image/jpeg;base64,Rm9v' + 'image' => 'data:image/jpeg;base64,Rm9v', ], factory(User::class)->states('admin')->create()) ->assertStatus(200); } @@ -47,7 +47,7 @@ class ArtistImageTest extends TestCase ->never(); $this->putAsUser('api/artist/9999/image', [ - 'image' => 'data:image/jpeg;base64,Rm9v' + 'image' => 'data:image/jpeg;base64,Rm9v', ], factory(User::class)->create()) ->assertStatus(403); } diff --git a/tests/Feature/DownloadTest.php b/tests/Feature/DownloadTest.php index 46d91a56..a50cbb07 100644 --- a/tests/Feature/DownloadTest.php +++ b/tests/Feature/DownloadTest.php @@ -11,7 +11,6 @@ use App\Repositories\InteractionRepository; use App\Services\DownloadService; use Exception; use Illuminate\Support\Collection; -use Illuminate\Testing\TestResponse; use Mockery; use Mockery\MockInterface; diff --git a/tests/Feature/SongTest.php b/tests/Feature/SongTest.php index 25a0acf8..51778d6d 100644 --- a/tests/Feature/SongTest.php +++ b/tests/Feature/SongTest.php @@ -205,7 +205,7 @@ class SongTest extends TestCase /** @var Album $compilationAlbum */ $compilationAlbum = Album::where([ 'artist_id' => Artist::VARIOUS_ID, - 'name' => 'Two by Two' + 'name' => 'Two by Two', ])->first(); self::assertNotNull($compilationAlbum); @@ -235,7 +235,7 @@ class SongTest extends TestCase $compilationAlbum = Album::where([ 'artist_id' => Artist::VARIOUS_ID, - 'name' => 'One by One' + 'name' => 'One by One', ])->first(); self::assertNotNull($compilationAlbum); diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index a5cc3e51..052ed5b7 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -23,7 +23,7 @@ class UserTest extends TestCase 'name' => 'Foo', 'email' => 'bar@baz.com', 'password' => 'qux', - 'is_admin' => false + 'is_admin' => false, ])->assertStatus(403); } @@ -39,7 +39,7 @@ class UserTest extends TestCase 'name' => 'Foo', 'email' => 'bar@baz.com', 'password' => 'qux', - 'is_admin' => true + 'is_admin' => true, ], factory(User::class)->states('admin')->create()); self::assertDatabaseHas('users', [ diff --git a/tests/Integration/Listeners/UpdateLastfmNowPlayingTest.php b/tests/Integration/Listeners/UpdateLastfmNowPlayingTest.php index 1e1237c2..8616c177 100644 --- a/tests/Integration/Listeners/UpdateLastfmNowPlayingTest.php +++ b/tests/Integration/Listeners/UpdateLastfmNowPlayingTest.php @@ -8,7 +8,6 @@ use App\Listeners\UpdateLastfmNowPlaying; use App\Models\Song; use App\Models\User; use App\Services\LastfmService; -use Exception; use Illuminate\Support\Facades\Queue; use Mockery; use Mockery\MockInterface; diff --git a/tests/Integration/Services/MediaMetadataServiceTest.php b/tests/Integration/Services/MediaMetadataServiceTest.php index 840b8caa..2273a245 100644 --- a/tests/Integration/Services/MediaMetadataServiceTest.php +++ b/tests/Integration/Services/MediaMetadataServiceTest.php @@ -2,11 +2,11 @@ namespace Tests\Integration\Services; +use function App\Helpers\album_cover_path; +use function App\Helpers\album_cover_url; use App\Models\Album; use App\Services\MediaMetadataService; use Tests\TestCase; -use function App\Helpers\album_cover_path; -use function App\Helpers\album_cover_url; class MediaMetadataServiceTest extends TestCase { @@ -18,7 +18,7 @@ class MediaMetadataServiceTest extends TestCase public function testGetAlbumThumbnailUrl(): void { - copy(__DIR__ . '/../../blobs/cover.png', album_cover_path('album-cover-for-thumbnail-test.jpg')); + copy(__DIR__.'/../../blobs/cover.png', album_cover_path('album-cover-for-thumbnail-test.jpg')); $album = factory(Album::class)->create(['cover' => 'album-cover-for-thumbnail-test.jpg']); diff --git a/tests/Integration/Services/SmartPlaylistServiceTest.php b/tests/Integration/Services/SmartPlaylistServiceTest.php index 44a2de5b..15de65b8 100644 --- a/tests/Integration/Services/SmartPlaylistServiceTest.php +++ b/tests/Integration/Services/SmartPlaylistServiceTest.php @@ -114,7 +114,7 @@ class SmartPlaylistServiceTest extends TestCase self::assertSame($sql, $query->toSql()); $queryBinding = $query->getBindings(); - for ($i = 0, $count = count($queryBinding); $i < $count; $i++) { + for ($i = 0, $count = count($queryBinding); $i < $count; ++$i) { self::assertSame( $bindings[$i], is_object($queryBinding[$i]) ? (string) $queryBinding[$i] : $queryBinding[$i] diff --git a/tests/Traits/CreatesApplication.php b/tests/Traits/CreatesApplication.php index 999cfbdc..2dc8c997 100644 --- a/tests/Traits/CreatesApplication.php +++ b/tests/Traits/CreatesApplication.php @@ -9,7 +9,7 @@ use Illuminate\Foundation\Application; trait CreatesApplication { - protected $mediaPath = __DIR__ . '/../songs'; + protected $mediaPath = __DIR__.'/../songs'; /** @var Kernel */ private $artisan; @@ -24,7 +24,7 @@ trait CreatesApplication public function createApplication() { /** @var Application $app */ - $app = require __DIR__ . '/../../bootstrap/app.php'; + $app = require __DIR__.'/../../bootstrap/app.php'; $this->artisan = $app->make(Artisan::class); $this->artisan->bootstrap(); diff --git a/tests/Unit/Jobs/UpdateLastfmNowPlayingJobTest.php b/tests/Unit/Jobs/UpdateLastfmNowPlayingJobTest.php index a839590c..9bd69f71 100644 --- a/tests/Unit/Jobs/UpdateLastfmNowPlayingJobTest.php +++ b/tests/Unit/Jobs/UpdateLastfmNowPlayingJobTest.php @@ -11,7 +11,7 @@ use Tests\TestCase; class UpdateLastfmNowPlayingJobTest extends TestCase { - /** @var UpdateLastfmNowPlayingJob */ + /** @var UpdateLastfmNowPlayingJob */ private $job; /** @var User */ diff --git a/tests/Unit/Services/MediaMetadataServiceTest.php b/tests/Unit/Services/MediaMetadataServiceTest.php index 8a7195f5..6955a51b 100644 --- a/tests/Unit/Services/MediaMetadataServiceTest.php +++ b/tests/Unit/Services/MediaMetadataServiceTest.php @@ -2,6 +2,8 @@ namespace Tests\Unit\Services; +use function App\Helpers\album_cover_url; +use function App\Helpers\artist_image_url; use App\Models\Album; use App\Models\Artist; use App\Services\ImageWriter; @@ -10,8 +12,6 @@ use Illuminate\Log\Logger; use Mockery; use Mockery\MockInterface; use Tests\TestCase; -use function App\Helpers\album_cover_url; -use function App\Helpers\artist_image_url; class MediaMetadataServiceTest extends TestCase {