1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/15540] Add types

PHPBB3-15540
This commit is contained in:
rubencm
2021-03-23 11:51:02 +01:00
parent a8de540e93
commit 658a0489d0
12 changed files with 140 additions and 133 deletions

View File

@@ -196,7 +196,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function get_word_length(): array
public function get_word_length()
{
return $this->word_length;
}
@@ -204,7 +204,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function split_keywords(&$keywords, $terms): bool
public function split_keywords(string &$keywords, string $terms): bool
{
if ($terms == 'all')
{
@@ -342,7 +342,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
public function keyword_search(string $type, string $fields, string $terms, array $sort_by_sql, string $sort_key, string $sort_dir, string $sort_days, array $ex_fid_ary, string $post_visibility, int $topic_id, array $author_ary, string $author_name, array &$id_ary, int &$start, int $per_page)
{
// No keywords? No posts
if (!$this->search_query)
@@ -590,7 +590,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
public function author_search(string $type, bool $firstpost_only, array $sort_by_sql, string $sort_key, string $sort_dir, string $sort_days, array $ex_fid_ary, string $post_visibility, int $topic_id, array $author_ary, string $author_name, array &$id_ary, int &$start, int $per_page)
{
// No author? No posts
if (!count($author_ary))
@@ -844,7 +844,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
public function index(string $mode, int $post_id, string &$message, string &$subject, int $poster_id, int $forum_id)
{
// Split old and new post/subject to obtain array of words
$split_text = $this->split_message($message);
@@ -892,7 +892,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function index_remove($post_ids, $author_ids, $forum_ids)
public function index_remove(array $post_ids, array $author_ids, array $forum_ids): void
{
$this->destroy_cache([], array_unique($author_ids));
}
@@ -900,7 +900,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function tidy()
public function tidy(): void
{
// destroy too old cached search results
$this->destroy_cache([]);
@@ -911,7 +911,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function create_index(int &$post_counter = null): ?array
public function create_index(int &$post_counter = 0): ?array
{
// Make sure we can actually use MySQL with fulltext indexes
if ($error = $this->init())
@@ -1049,7 +1049,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function index_created()
public function index_created(): bool
{
if (empty($this->stats))
{
@@ -1146,7 +1146,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function acp()
public function acp(): array
{
$tpl = '
<dl>