enable static analysis for all themes

This commit is contained in:
Shish 2023-12-16 01:25:56 +00:00
parent 62e4354598
commit dba8acea02
3 changed files with 5 additions and 3 deletions

View file

@ -4,6 +4,6 @@ parameters:
- ../core - ../core
- ../ext - ../ext
- ../tests - ../tests
- ../themes/default - ../themes
ignoreErrors: ignoreErrors:
- '#Access to an undefined property Shimmie2\\Image::\$#' - '#Access to an undefined property Shimmie2\\Image::\$#'

View file

@ -6,6 +6,8 @@ namespace Shimmie2;
class CustomIndexTheme extends IndexTheme class CustomIndexTheme extends IndexTheme
{ {
public static array $_search_query = [];
protected function build_table(array $images, ?string $query): string protected function build_table(array $images, ?string $query): string
{ {
global $user; global $user;
@ -27,7 +29,7 @@ class CustomIndexTheme extends IndexTheme
$nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms); $nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms);
if (!empty($this->search_terms)) { if (!empty($this->search_terms)) {
$page->_search_query = $this->search_terms; static::$_search_query = $this->search_terms;
} }
$page->add_block(new Block("Navigation", $nav, "left", 0)); $page->add_block(new Block("Navigation", $nav, "left", 0));

View file

@ -53,7 +53,7 @@ class Page extends BasePage
} }
} }
$query = !empty($this->_search_query) ? html_escape(Tag::implode($this->_search_query)) : ""; $query = !empty(CustomIndexTheme::$_search_query) ? html_escape(Tag::implode(CustomIndexTheme::$_search_query)) : "";
assert(!is_null($query)); # used in header.inc, do not remove :P assert(!is_null($query)); # used in header.inc, do not remove :P
$flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : ""; $flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : "";
$generated = autodate(date('c')); $generated = autodate(date('c'));