about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-24 17:22:36 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-24 17:22:36 +0300
commitf8cd8e746f9d02b8fb009ed25ba87656f71d093a (patch)
tree744c6391f72224960b615e0ee72fe0cace68b89d
parent6f660eedb640eaa31e75cfd2543692d7f494ddd6 (diff)
downloadthe-epube-f8cd8e746f9d02b8fb009ed25ba87656f71d093a.tar.gz
the-epube-f8cd8e746f9d02b8fb009ed25ba87656f71d093a.tar.xz
give AuthMiddleware more appropriate name, update phpstan config
-rw-r--r--.gitignore1
-rw-r--r--backend.php2
-rw-r--r--classes/CsrfMiddleware.php (renamed from classes/AuthMiddleware.php)2
-rw-r--r--phpstan.neon6
4 files changed, 9 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index c85a4d8..f3d46c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 .idea/*
 /node_modules
 /vendor/**/.git
+/.phpstan-tmp
diff --git a/backend.php b/backend.php
index de308a7..cdfc71a 100644
--- a/backend.php
+++ b/backend.php
@@ -24,7 +24,7 @@
 	$op = $_REQUEST["op"] ?? "";
 
 	$router = new Router();
-	$router->addMiddleware(new AuthMiddleware());
+	$router->addMiddleware(new CsrfMiddleware());
 
 	$router->addRoute("cover", new \Handler\CoverHandler());
 	$router->addRoute("getinfo", new \Handler\GetinfoHandler());
diff --git a/classes/AuthMiddleware.php b/classes/CsrfMiddleware.php
index 68b2585..8510766 100644
--- a/classes/AuthMiddleware.php
+++ b/classes/CsrfMiddleware.php
@@ -1,6 +1,6 @@
 <?php
 
-class AuthMiddleware implements MiddlewareInterface
+class CsrfMiddleware implements MiddlewareInterface
 {
     /** @var array<string> */
     private array $csrfIgnore = [
diff --git a/phpstan.neon b/phpstan.neon
index e6efb02..2ef848c 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,6 +1,12 @@
 parameters:
    level: 6
+   tmpDir: .phpstan-tmp
+   parallel:
+      maximumNumberOfProcesses: 4
    ignoreErrors:
+      # set_include_path detection issue
+      - message: '#"(common)\.php"#'
+        identifier: requireOnce.fileNotFound
    excludePaths:
       - node_modules/*
       - vendor/**/*