summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-14 14:47:55 +0100
committerSimon Rettberg2023-11-14 14:47:55 +0100
commit06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch)
tree7e5493b102074672d8cfd8fe1a61e49f080edbe8 /index.php
parentUpdate phpstorm config (diff)
downloadslx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'index.php')
-rw-r--r--index.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/index.php b/index.php
index 78d23111..6b5305b2 100644
--- a/index.php
+++ b/index.php
@@ -48,7 +48,7 @@ abstract class Page
public static function render()
{
$pageTitle = self::$module->getPageTitle();
- if ($pageTitle !== false) {
+ if (!empty($pageTitle)) {
Render::setTitle($pageTitle, false);
}
self::$instance->doRender();
@@ -155,9 +155,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!Util::verifyToken()) {
if (AJAX) {
die('CSRF/XSS? Missing token in POST request!');
- } else {
- Util::redirect('?do=Main');
}
+ Util::redirect('?do=Main');
}
}
@@ -190,7 +189,7 @@ if (defined('CONFIG_DEBUG') && CONFIG_DEBUG) {
* @param int $code Error code to map
* @return string Readable error type
*/
- function mapErrorCode($code)
+ function mapErrorCode(int $code): string
{
switch ($code) {
case E_PARSE: