Skip to content

Commit

Permalink
enable static analysis for all themes
Browse files Browse the repository at this point in the history
shish committed Dec 16, 2023
1 parent 62e4354 commit dba8ace
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/phpstan.neon
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@ parameters:
- ../core
- ../ext
- ../tests
- ../themes/default
- ../themes
ignoreErrors:
- '#Access to an undefined property Shimmie2\\Image::\$#'
4 changes: 3 additions & 1 deletion themes/rule34v2/index.theme.php
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@

class CustomIndexTheme extends IndexTheme
{
public static array $_search_query = [];

protected function build_table(array $images, ?string $query): string
{
global $user;
@@ -27,7 +29,7 @@ public function display_page(Page $page, $images)

$nav = $this->build_navigation($this->page_number, $this->total_pages, $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));

2 changes: 1 addition & 1 deletion themes/rule34v2/page.class.php
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ public function render()
}
}

$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
$flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : "";
$generated = autodate(date('c'));

0 comments on commit dba8ace

Please sign in to comment.