MAPG-199 fix issues found by PHPStan

This commit is contained in:
bence committed 2020-07-05 23:18:56 +02:00
1 parent 39d691fd7f
commit af98d71924
34 files changed
+89 -68

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ class HtmlContent extends ContentBase
require ROOT . '/cache/views/' . $this->view . '.php';
// @phpstan-ignore-next-line - SCRIPT_STARTED is defined in main.php
echo '<!-- __debug__runtime: ' . round((hrtime(true) - SCRIPT_STARTED) / 1e+6, 1) . ' -->';
}
+1
View File
@@ -9,6 +9,7 @@ class JsonContent extends ContentBase
public function render(): void
{
// @phpstan-ignore-next-line - SCRIPT_STARTED is defined in main.php
$this->data['__debug__runtime'] = round((hrtime(true) - SCRIPT_STARTED) / 1e+6, 1);
echo json_encode($this->data);
+1 -1
View File
@@ -16,7 +16,7 @@ class Redirect implements IRedirect
public function getUrl(): string
{
if (preg_match('/^http(s)?/', $this->target)) {
if (preg_match('/^http(s)?/', $this->target) === 1) {
$link = $this->target;
} else {
$link = \Container::$request->getBase() . '/' . $this->target;