1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16955] Fix most return types in phpdoc

PHPBB3-16955
This commit is contained in:
Ruben Calvo
2023-01-01 22:01:52 +01:00
parent 3e8fced5c8
commit daa2dd280c
66 changed files with 135 additions and 124 deletions

View File

@@ -340,7 +340,7 @@ class context
* If key is false the position is set to 0
* If key is true the position is set to the last entry
*
* @return mixed false if not found, index position otherwise; be sure to test with ===
* @return false|int false if not found, index position otherwise; be sure to test with ===
*/
public function find_key_index($blockname, $key)
{
@@ -377,7 +377,7 @@ class context
// Change key to zero (change first position) if false and to last position if true
if (is_bool($key))
{
return (!$key) ? 0 : count($block) - 1;
return (!$key) ? 0 : (count($block) ?? 0) - 1;
}
// Get correct position if array given

View File

@@ -54,9 +54,9 @@ class environment extends \Twig\Environment
* @param \phpbb\filesystem\filesystem $filesystem
* @param \phpbb\path_helper $path_helper phpBB path helper
* @param string $cache_path The path to the cache directory
* @param \phpbb\extension\manager $extension_manager phpBB extension manager
* @param \Twig\Loader\LoaderInterface $loader Twig loader interface
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param \phpbb\extension\manager|null $extension_manager phpBB extension manager
* @param \Twig\Loader\LoaderInterface|null $loader Twig loader interface
* @param \phpbb\event\dispatcher_interface|null $phpbb_dispatcher Event dispatcher object
* @param array $options Array of options to pass to Twig
*/
public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig\Loader\LoaderInterface $loader = null, \phpbb\event\dispatcher_interface $phpbb_dispatcher = null, $options = array())
@@ -195,7 +195,7 @@ class environment extends \Twig\Environment
}
/**
* {@inheritdoc}
* Get template with assets
*/
private function display_with_assets($name, array $context = [])
{
@@ -261,7 +261,7 @@ class environment extends \Twig\Environment
*
* @param string $cls The template class associated with the given template name
* @param string $name The template name
* @param integer $index The index if it is an embedded template
* @param integer|null $index The index if it is an embedded template
* @return \Twig\Template A template instance representing the given template name
* @throws \Twig\Error\LoaderError
*/