Линтовка

This commit is contained in:
2026-01-03 01:12:18 +08:00
parent ddc4374dd6
commit aabad9d744
20 changed files with 224 additions and 190 deletions

View File

@@ -1,4 +1,5 @@
<?php
/*
* Copyright (c) 2025, Антон Аксенов
* This file is part of m3u.su project
@@ -72,6 +73,7 @@ class IniFile
{
empty($this->playlists) && $this->load();
$data = redis()->get($code);
return $this->initPlaylist($code, $data);
}
@@ -96,11 +98,11 @@ class IniFile
protected function initPlaylist(string $code, array|false $data): array
{
if ($data === false) {
$raw = $this->playlists[$code]
$raw = $this->playlists[$code]
?? throw new PlaylistNotFoundException($code);
$data = [
'code' => $code,
'name' => $raw['name'] ?? "Плейлист #$code",
'name' => $raw['name'] ?? "Плейлист #{$code}",
'description' => $raw['desc'] ?? null,
'url' => $raw['pls'],
'source' => $raw['src'] ?? null,
@@ -182,7 +184,7 @@ class IniFile
return array_any(
$badAttributes,
static fn (string $badAttribute) => preg_match_all("/$badAttribute/", $string) >= 1,
static fn (string $badAttribute) => preg_match_all("/{$badAttribute}/", $string) >= 1,
);
}
}