mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-19 23:11:45 +02:00
[ticket/16955] Clean up installer classes for psalm
PHPBB3-16955
This commit is contained in:
@@ -75,7 +75,7 @@ class container_factory
|
||||
*
|
||||
* @param null|string $service_name Name of the service to return
|
||||
*
|
||||
* @return \Symfony\Component\DependencyInjection\ContainerInterface|Object phpBB's dependency injection container
|
||||
* @return \Symfony\Component\DependencyInjection\ContainerInterface|object|null phpBB's dependency injection container
|
||||
* or the service specified in $service_name
|
||||
*
|
||||
* @throws cannot_build_container_exception When container cannot be built
|
||||
@@ -91,7 +91,7 @@ class container_factory
|
||||
$this->build_container();
|
||||
}
|
||||
|
||||
return ($service_name === null) ? $this->container : $this->container->get($service_name);
|
||||
return $service_name === null ? $this->container : $this->container->get($service_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,7 +21,7 @@ use phpbb\install\helper\update_helper;
|
||||
class compression_file_updater implements file_updater_interface
|
||||
{
|
||||
/**
|
||||
* @var \compress|null
|
||||
* @var \compress_zip|\compress_tar|null
|
||||
*/
|
||||
protected $compress;
|
||||
|
||||
@@ -86,7 +86,10 @@ class compression_file_updater implements file_updater_interface
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
$this->compress->close();
|
||||
if ($this->compress !== null)
|
||||
{
|
||||
$this->compress->close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -82,7 +82,7 @@ class ajax_iohandler extends iohandler_base
|
||||
protected $redirect_url;
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
* @var resource|closed-resource
|
||||
*/
|
||||
protected $file_lock_pointer;
|
||||
|
||||
@@ -235,7 +235,9 @@ class ajax_iohandler extends iohandler_base
|
||||
'form_install' => 'installer_form.html',
|
||||
));
|
||||
|
||||
return $this->template->assign_display('form_install');
|
||||
$compiled_template = $this->template->assign_display('form_install');
|
||||
|
||||
return is_string($compiled_template) ? $compiled_template : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -188,11 +188,11 @@ class cli_iohandler extends iohandler_base
|
||||
/**
|
||||
* {@inheritdoc
|
||||
*/
|
||||
public function add_success_message($error_title, $error_description = false)
|
||||
public function add_success_message($success_title, $success_description = false)
|
||||
{
|
||||
$this->io->newLine();
|
||||
|
||||
$message = $this->translate_message($error_title, $error_description);
|
||||
$message = $this->translate_message($success_title, $success_description);
|
||||
$message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : '');
|
||||
$this->io->success($message_string);
|
||||
|
||||
|
@@ -52,7 +52,7 @@ class factory
|
||||
/**
|
||||
* Factory getter for iohandler
|
||||
*
|
||||
* @return \phpbb\install\helper\iohandler\iohandler_interface
|
||||
* @return \phpbb\install\helper\iohandler\iohandler_interface|null
|
||||
*
|
||||
* @throws iohandler_not_implemented_exception
|
||||
* When the specified iohandler_interface does not exists
|
||||
@@ -63,17 +63,16 @@ class factory
|
||||
{
|
||||
case 'ajax':
|
||||
return $this->container->get('installer.helper.iohandler_ajax');
|
||||
break;
|
||||
|
||||
case 'nojs':
|
||||
// @todo replace this
|
||||
return $this->container->get('installer.helper.iohandler_ajax');
|
||||
break;
|
||||
|
||||
case 'cli':
|
||||
return $this->container->get('installer.helper.iohandler_cli');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new iohandler_not_implemented_exception();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -89,6 +89,7 @@ class update_helper
|
||||
* @param string $version_number2
|
||||
* @param string|null $operator
|
||||
* @return int|bool The returned value is identical to the PHP build-in function version_compare()
|
||||
* @psalm-suppress InvalidNullableReturnType, NullableReturnStatement
|
||||
*/
|
||||
public function phpbb_version_compare($version_number1, $version_number2, $operator = null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user