mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Replace Psalm with PHPStan + PHP‑CS‑Fixer + Biome, add linting configs & cleanup
- Removed the `vimeo/psalm` dependency and all related files (`psalm.xml`, `psalm‑baseline.xml`, suppress annotations). - Added **PHPStan** (v2.1.54) and **PHP‑CS‑Fixer** (v3.95.1) to `vendor/bin/`. - Created `phpstan.neon` (level 5, bootstraps `app/bootstrap.php`, scans `Parsedown.php`). - Created `phpstan‑baseline.neon` with 10 pre‑existing errors. - Added `.php‑cs‑fixer.dist.php` (PSR‑12 + PHP80Migration, targets `app/src` & `app/tests`). - Added `biome.json` and updated `justfile` to replace the old Psalm recipes with `phpstan`, `cs‑check`, and `cs‑fix`. - Updated `.gitignore` to exclude PHPStan and PHP‑CS‑Fixer cache files. - Updated several JS files (`file‑preview.js`, `file‑upload‑queue.js`) eand PHP controllers (`MediaController.php`, `SearchController.php`, `SystemController.php`). - Minor adjustments to `TODO.md`, `app/src/Database.php`, `app/src/Parsedown.php`, `app/src/ShareLink.php`, and `app/src/SmtpRelay.php`.
This commit is contained in:
@@ -98,9 +98,9 @@ class SystemController
|
||||
$info = [
|
||||
'version' => PHP_VERSION,
|
||||
'sapi' => PHP_SAPI,
|
||||
'memory_limit' => ini_get('memory_limit'),
|
||||
'upload_max' => ini_get('upload_max_filesize'),
|
||||
'post_max' => ini_get('post_max_size'),
|
||||
'memory_limit' => (string) ini_get('memory_limit'),
|
||||
'upload_max' => (string) ini_get('upload_max_filesize'),
|
||||
'post_max' => (string) ini_get('post_max_size'),
|
||||
'max_exec' => ini_get('max_execution_time') . 's',
|
||||
];
|
||||
$this->cache->set('php_info', $info);
|
||||
@@ -123,7 +123,7 @@ class SystemController
|
||||
$total = (int) disk_total_space(APP_ROOT);
|
||||
$free = (int) disk_free_space(APP_ROOT);
|
||||
$used = $total - $free;
|
||||
$pct = $total > 0 ? (int) round($used / $total * 100) : 0;
|
||||
$pct = $total > 0 ? (int) round((float) $used / (float) $total * 100.0) : 0;
|
||||
|
||||
$info = ['total' => $total, 'free' => $free, 'used' => $used, 'pct' => $pct];
|
||||
$this->cache->set('disk_info', $info);
|
||||
@@ -449,7 +449,7 @@ class SystemController
|
||||
]);
|
||||
$start = microtime(true);
|
||||
curl_exec($ch);
|
||||
$ms = (int) round((microtime(true) - $start) * 1000);
|
||||
$ms = (int) round((microtime(true) - $start) * 1000.0);
|
||||
$code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
return $code > 0 ? [$code, $ms] : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user