1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-22 16:22:58 +02:00

[ticket/17496] Fix Implicitly marking parameters as nullable PHP deprecations

Also use union types consistently instead of question marks.
Fixed with php-cs-fixer.

PHPBB-17496
This commit is contained in:
rxu
2025-04-15 12:14:21 +07:00
parent bdbd0be548
commit 7d1ae5bf19
64 changed files with 113 additions and 113 deletions

View File

@@ -316,7 +316,7 @@ abstract class base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function create_index(int &$post_counter = 0): ?array
public function create_index(int &$post_counter = 0): array|null
{
$max_post_id = $this->get_max_post_id();
$forums_indexing_enabled = $this->forum_ids_with_indexing_enabled();
@@ -377,7 +377,7 @@ abstract class base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function delete_index(int &$post_counter = null): ?array
public function delete_index(int|null &$post_counter = null): array|null
{
$max_post_id = $this->get_max_post_id();

View File

@@ -912,7 +912,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function create_index(int &$post_counter = 0): ?array
public function create_index(int &$post_counter = 0): array|null
{
// Make sure we can actually use MySQL with fulltext indexes
if ($error = $this->init())
@@ -984,7 +984,7 @@ class fulltext_mysql extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function delete_index(int &$post_counter = null): ?array
public function delete_index(int|null &$post_counter = null): array|null
{
// Make sure we can actually use MySQL with fulltext indexes
if ($error = $this->init())

View File

@@ -1621,7 +1621,7 @@ class fulltext_native extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function delete_index(int &$post_counter = null): ?array
public function delete_index(int|null &$post_counter = null): array|null
{
$truncate_tables = [
$this->search_wordlist_table,

View File

@@ -867,7 +867,7 @@ class fulltext_postgres extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function create_index(int &$post_counter = 0): ?array
public function create_index(int &$post_counter = 0): array|null
{
// Make sure we can actually use PostgreSQL with fulltext indexes
if ($error = $this->init())
@@ -926,7 +926,7 @@ class fulltext_postgres extends base implements search_backend_interface
/**
* {@inheritdoc}
*/
public function delete_index(int &$post_counter = null): ?array
public function delete_index(int|null &$post_counter = null): array|null
{
// Make sure we can actually use PostgreSQL with fulltext indexes
if ($error = $this->init())

View File

@@ -629,7 +629,7 @@ class fulltext_sphinx implements search_backend_interface
/**
* {@inheritdoc}
*/
public function create_index(int &$post_counter = 0): ?array
public function create_index(int &$post_counter = 0): array|null
{
if (!$this->index_created())
{
@@ -656,7 +656,7 @@ class fulltext_sphinx implements search_backend_interface
/**
* {@inheritdoc}
*/
public function delete_index(int &$post_counter = null): ?array
public function delete_index(int|null &$post_counter = null): array|null
{
if ($this->index_created())
{

View File

@@ -163,7 +163,7 @@ interface search_backend_interface
* @param int $post_counter
* @return array|null array with current status or null if finished
*/
public function create_index(int &$post_counter = 0): ?array;
public function create_index(int &$post_counter = 0): array|null;
/**
* Drop fulltext index
@@ -171,7 +171,7 @@ interface search_backend_interface
* @param int $post_counter
* @return array|null array with current status or null if finished
*/
public function delete_index(int &$post_counter = 0): ?array;
public function delete_index(int &$post_counter = 0): array|null;
/**
* Returns true if both FULLTEXT indexes exist

View File

@@ -28,7 +28,7 @@ class config
* @param string $name The name of the section that shall be returned
* @return config_section|null The section object or null if none was found
*/
public function get_section_by_name(string $name): ?config_section
public function get_section_by_name(string $name): config_section|null
{
for ($i = 0, $size = count($this->sections); $i < $size; $i++)
{

View File

@@ -60,7 +60,7 @@ class config_section extends config_item
* @return config_variable|null The first variable object from this section with the
* given name or null if none was found
*/
public function get_variable_by_name(string $name): ?config_variable
public function get_variable_by_name(string $name): config_variable|null
{
for ($i = 0, $size = count($this->variables); $i < $size; $i++)
{