mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
fix: solve some warnings
Notifications.php: make $count parameter explicit as it is placed before another explicit parameter OpenVKPresenter.php: add additional null checks Themepacks.php: add return type to offsetGet
This commit is contained in:
parent
2eb15cb600
commit
e813549602
3 changed files with 4 additions and 4 deletions
|
@ -30,7 +30,7 @@ class Notifications
|
||||||
return (new $repoClassName)->get($id);
|
return (new $repoClassName)->get($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getQuery(User $user, bool $count = false, int $offset, bool $archived = false, int $page = 1, ?int $perPage = NULL): string
|
private function getQuery(User $user, bool $count, int $offset, bool $archived = false, int $page = 1, ?int $perPage = NULL): string
|
||||||
{
|
{
|
||||||
$query = "SELECT " . ($count ? "COUNT(*) AS cnt" : "*") . " FROM notifications WHERE recipientType=0 ";
|
$query = "SELECT " . ($count ? "COUNT(*) AS cnt" : "*") . " FROM notifications WHERE recipientType=0 ";
|
||||||
$query .= "AND timestamp " . ($archived ? "<" : ">") . "$offset AND recipientId=" . $user->getId();
|
$query .= "AND timestamp " . ($archived ? "<" : ">") . "$offset AND recipientId=" . $user->getId();
|
||||||
|
|
|
@ -274,7 +274,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
||||||
setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
|
setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
|
||||||
|
|
||||||
if (!OPENVK_ROOT_CONF["openvk"]["preferences"]["maintenanceMode"]["all"]) {
|
if (!OPENVK_ROOT_CONF["openvk"]["preferences"]["maintenanceMode"]["all"]) {
|
||||||
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["maintenanceMode"][$this->presenterName]) {
|
if ($this->presenterName && OPENVK_ROOT_CONF["openvk"]["preferences"]["maintenanceMode"][$this->presenterName]) {
|
||||||
$this->pass("openvk!Maintenance->section", $this->presenterName);
|
$this->pass("openvk!Maintenance->section", $this->presenterName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -307,7 +307,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
||||||
$theme = Themepacks::i()[Session::i()->get("_sessionTheme", "ovk")];
|
$theme = Themepacks::i()[Session::i()->get("_sessionTheme", "ovk")];
|
||||||
} else if($this->requestParam("themePreview")) {
|
} else if($this->requestParam("themePreview")) {
|
||||||
$theme = Themepacks::i()[$this->requestParam("themePreview")];
|
$theme = Themepacks::i()[$this->requestParam("themePreview")];
|
||||||
} else if($this->user->identity !== NULL && $this->user->identity->getTheme()) {
|
} else if($this->user !== NULL && $this->user->identity !== NULL && $this->user->identity->getTheme()) {
|
||||||
$theme = $this->user->identity->getTheme();
|
$theme = $this->user->identity->getTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ class Themepacks implements \ArrayAccess
|
||||||
return $offset === Themepacks::DEFAULT_THEME_ID ? false : isset($this->loadedThemepacks[$offset]);
|
return $offset === Themepacks::DEFAULT_THEME_ID ? false : isset($this->loadedThemepacks[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function offsetGet($offset)
|
function offsetGet($offset) : mixed
|
||||||
{
|
{
|
||||||
return $this->loadedThemepacks[$offset];
|
return $this->loadedThemepacks[$offset];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue