Удалён мёртвый код

This commit is contained in:
2025-05-13 14:22:48 +08:00
parent 62d07ca2aa
commit f100d9ae72
8 changed files with 2 additions and 100 deletions

View File

@@ -109,6 +109,7 @@ class WebController extends BasicController
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
* @throws Exception
*/
public function details(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{

View File

@@ -17,11 +17,6 @@ use Exception;
*/
class IniFile
{
/**
* @var array Считанное из файла содержимое ini-файла
*/
protected array $ini;
/**
* @var array[] Коллекция подгруженных плейлистов
*/

View File

@@ -11,7 +11,6 @@ namespace App\Core;
use App\Core\TwigExtention as IptvTwigExtension;
use Dotenv\Dotenv;
use GuzzleHttp\Client;
use InvalidArgumentException;
use Redis;
use Slim\App;
@@ -56,11 +55,6 @@ final class Kernel
*/
protected ?Redis $cache = null;
/**
* @var Client|null
*/
protected ?Client $httpClient = null;
/**
* Закрытый конструктор
*
@@ -198,16 +192,6 @@ final class Kernel
return $this->cache;
}
/**
* Возвращает объект http-клиента
*
* @return Client
*/
public function guzzle(): Client
{
return $this->httpClient ??= new Client($this->config['http']);
}
/**
* Возвращает значение из конфига
*

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace App\Core;
use Twig\Error\LoaderError;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
@@ -20,6 +19,7 @@ class TwigExtention extends AbstractExtension
{
/**
* @inheritDoc
* @noinspection PhpUnused
*/
public function getFunctions(): array
{
@@ -38,7 +38,6 @@ class TwigExtention extends AbstractExtension
* @param string $key Ключ в формате "config.key"
* @param mixed|null $default Значение по умолчанию
* @return mixed
* @throws LoaderError
*/
public function config(string $key, mixed $default = null): mixed
{

View File

@@ -1,34 +0,0 @@
<?php
/*
* Copyright (c) 2025, Антон Аксенов
* This file is part of iptv.axenov.dev web interface
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
*/
declare(strict_types=1);
namespace App\Middleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
/**
* Middleware для добавления запросу заголовка X-Request-ID
*/
class RequestId
{
/**
* Добавляет запросу заголовок X-Request-ID
*
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$request = $request->withHeader('X-Request-ID', uniqid());
return $handler->handle($request);
}
}

View File

@@ -44,17 +44,6 @@ function cache_path(string $path = ''): string
return root_path("cache/$path");
}
/**
* Returns path to app views
*
* @param string $path
* @return string
*/
function views_path(string $path = ''): string
{
return root_path("views/$path");
}
/**
* Returns base URL
*