Clean code

This commit is contained in:
julien
2026-03-27 22:30:10 +01:00
parent 68c547ddcb
commit 7757628a94
29 changed files with 164 additions and 268 deletions

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
class AssetController extends BaseController
class AssetController
{
private const ALLOWED = [
'app.css' => 'text/css',
@@ -11,13 +11,15 @@ class AssetController extends BaseController
public function serve(): void
{
$file = basename((string) $this->f3->get('PARAMS.file'));
$f3 = Base::instance();
$file = basename((string) $f3->get('PARAMS.file'));
if (!array_key_exists($file, self::ALLOWED)) {
$this->f3->error(404);
$f3->error(404);
return;
}
$f3->expire(86400);
echo Web::instance()->minify(
$file,
self::ALLOWED[$file],