mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Apply fixes from StyleCI (#790)
This commit is contained in:
parent
b227ece517
commit
3825452658
14 changed files with 34 additions and 33 deletions
|
@ -8,6 +8,6 @@ class Kernel extends ConsoleKernel
|
|||
{
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__ . '/Commands');
|
||||
$this->load(__DIR__.'/Commands');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class ScrobbleController extends Controller
|
|||
/**
|
||||
* Create a Last.fm scrobble entry 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
|
||||
*/
|
||||
|
|
|
@ -25,8 +25,7 @@ class SongController extends Controller
|
|||
StreamerFactory $streamerFactory,
|
||||
ArtistRepository $artistRepository,
|
||||
AlbumRepository $albumRepository
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->mediaInformationService = $mediaInformationService;
|
||||
$this->streamerFactory = $streamerFactory;
|
||||
$this->artistRepository = $artistRepository;
|
||||
|
@ -38,10 +37,10 @@ class SongController extends Controller
|
|||
*
|
||||
* @link https://github.com/phanan/koel/wiki#streaming-music
|
||||
*
|
||||
* @param null|bool $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.
|
||||
* Only taken into account if $transcode is truthy.
|
||||
* @param null|bool $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.
|
||||
* Only taken into account if $transcode is truthy.
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ class JWTEventListener
|
|||
{
|
||||
$events->listen(
|
||||
'tymon.jwt.valid',
|
||||
JWTEventListener::class . '@onValidUser'
|
||||
self::class.'@onValidUser'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class File
|
|||
* Construct our File object.
|
||||
* Upon construction, we'll set the path, hash, and associated Song object (if any).
|
||||
*
|
||||
* @param string|SplFileInfo $path Either the file's path, or a SplFileInfo object
|
||||
* @param string|SplFileInfo $path Either the file's path, or a SplFileInfo object
|
||||
*
|
||||
* @throws getid3_exception
|
||||
*
|
||||
|
@ -97,8 +97,7 @@ class File
|
|||
?MediaMetadataService $mediaMetadataService = null,
|
||||
?HelperService $helperService = null,
|
||||
?SongRepository $songRepository = null
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->splFileInfo = $path instanceof SplFileInfo ? $path : new SplFileInfo($path);
|
||||
$this->setGetID3($getID3);
|
||||
$this->setMediaMetadataService($mediaMetadataService);
|
||||
|
@ -201,7 +200,7 @@ class File
|
|||
* Sync the song with all available media info against the database.
|
||||
*
|
||||
* @param string[] $tags The (selective) tags to sync (if the song exists)
|
||||
* @param bool $force Whether to force syncing, even if the file is unchanged
|
||||
* @param bool $force Whether to force syncing, even if the file is unchanged
|
||||
*
|
||||
* @return bool|Song A Song object on success,
|
||||
* true if file exists but is unmodified,
|
||||
|
|
|
@ -76,12 +76,12 @@ class Song extends Model
|
|||
*
|
||||
* @param string[] $ids
|
||||
* @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).
|
||||
* - 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).
|
||||
*/
|
||||
public static function updateInfo(array $ids, array $data): Collection
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ class User extends Authenticatable
|
|||
* An alias to savePreference().
|
||||
*
|
||||
* @param mixed $val
|
||||
*
|
||||
* @see self::savePreference
|
||||
*/
|
||||
public function setPreference(string $key, $val): void
|
||||
|
|
|
@ -44,8 +44,8 @@ abstract class ApiClient
|
|||
* @param string $method The HTTP method
|
||||
* @param string $uri The API URI (segment)
|
||||
* @param bool $appendKey Whether to automatically append the API key into the URI.
|
||||
* While it's usually the case, some services (like Last.fm) requires
|
||||
* an "API signature" of the request. Appending an API key will break the request.
|
||||
* While it's usually the case, some services (like Last.fm) requires
|
||||
* an "API signature" of the request. Appending an API key will break the request.
|
||||
* @param mixed[] $params An array of parameters
|
||||
*
|
||||
* @return mixed|SimpleXMLElement|null
|
||||
|
@ -67,7 +67,7 @@ abstract class ApiClient
|
|||
|
||||
return $body;
|
||||
} catch (ClientException $e) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,9 @@ abstract class ApiClient
|
|||
* @param string $method The HTTP method
|
||||
* @param mixed[] $args An array of parameters
|
||||
*
|
||||
* @return mixed|null|SimpleXMLElement
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return mixed|null|SimpleXMLElement
|
||||
*/
|
||||
public function __call(string $method, array $args)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ abstract class ApiClient
|
|||
/**
|
||||
* 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
|
||||
{
|
||||
|
|
|
@ -5,6 +5,8 @@ namespace App\Services;
|
|||
interface ApiConsumerInterface
|
||||
{
|
||||
public function getEndpoint(): string;
|
||||
|
||||
public function getKey(): ?string;
|
||||
|
||||
public function getSecret(): ?string;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@ class HelperService
|
|||
*/
|
||||
public function getFileHash(string $path): string
|
||||
{
|
||||
return md5(config('app.key') . $path);
|
||||
return md5(config('app.key').$path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,7 @@ class MediaSyncService
|
|||
MediaMetadataService $mediaMetadataService,
|
||||
SongRepository $songRepository,
|
||||
HelperService $helperService
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->mediaMetadataService = $mediaMetadataService;
|
||||
$this->songRepository = $songRepository;
|
||||
$this->helperService = $helperService;
|
||||
|
|
|
@ -5,5 +5,6 @@ namespace App\Services\Streamers;
|
|||
interface TranscodingStreamerInterface extends StreamerInterface
|
||||
{
|
||||
public function setBitRate(int $bitRate): void;
|
||||
|
||||
public function setStartTime(float $startTime): void;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class YouTubeService extends ApiClient implements ApiConsumerInterface
|
|||
public function search(string $q, string $pageToken = '', int $perPage = 10)
|
||||
{
|
||||
if (!$this->enabled()) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
$uri = sprintf('search?part=snippet&type=video&maxResults=%s&pageToken=%s&q=%s',
|
||||
|
|
|
@ -15,8 +15,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
|
||||
*/
|
||||
|
@ -48,9 +48,9 @@ trait SupportsDeleteWhereIDsNotIn
|
|||
/**
|
||||
* Delete records chunk by chunk.
|
||||
*
|
||||
* @param string[]|int[] $ids The array of record IDs to delete
|
||||
* @param string $key Name of the primary key
|
||||
* @param int $chunkSize Size of each chunk. Defaults to 2^16-1 (65535)
|
||||
* @param string[]|int[] $ids The array of record IDs to delete
|
||||
* @param string $key Name of the primary key
|
||||
* @param int $chunkSize Size of each chunk. Defaults to 2^16-1 (65535)
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue