diff --git a/phpBB/phpbb/composer/exception/managed_with_clean_error_exception.php b/phpBB/phpbb/composer/exception/managed_with_clean_error_exception.php index 22addce1b7..f7f6d163db 100644 --- a/phpBB/phpbb/composer/exception/managed_with_clean_error_exception.php +++ b/phpBB/phpbb/composer/exception/managed_with_clean_error_exception.php @@ -29,7 +29,7 @@ class managed_with_clean_error_exception extends managed_with_error_exception */ public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0) { - parent::__construct($prefix . $message, $parameters, $previous, $code); + parent::__construct($prefix, $message, $parameters, $previous, $code); } } diff --git a/phpBB/phpbb/composer/exception/managed_with_enable_error_exception.php b/phpBB/phpbb/composer/exception/managed_with_enable_error_exception.php index f9b3ce571b..eace036aed 100644 --- a/phpBB/phpbb/composer/exception/managed_with_enable_error_exception.php +++ b/phpBB/phpbb/composer/exception/managed_with_enable_error_exception.php @@ -29,7 +29,7 @@ class managed_with_enable_error_exception extends managed_with_error_exception */ public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0) { - parent::__construct($prefix . $message, $parameters, $previous, $code); + parent::__construct($prefix, $message, $parameters, $previous, $code); } } diff --git a/phpBB/phpbb/composer/exception/managed_with_error_exception.php b/phpBB/phpbb/composer/exception/managed_with_error_exception.php index 2ea4600cf6..0ebb1e1adf 100644 --- a/phpBB/phpbb/composer/exception/managed_with_error_exception.php +++ b/phpBB/phpbb/composer/exception/managed_with_error_exception.php @@ -29,7 +29,6 @@ class managed_with_error_exception extends runtime_exception */ public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0) { - parent::__construct($prefix . $message, $parameters, $previous, $code); + parent::__construct($prefix, $message, $parameters, $previous, $code); } - } diff --git a/phpBB/phpbb/composer/extension_manager.php b/phpBB/phpbb/composer/extension_manager.php index f9d5ddb956..1e14a7591d 100644 --- a/phpBB/phpbb/composer/extension_manager.php +++ b/phpBB/phpbb/composer/extension_manager.php @@ -29,7 +29,7 @@ use phpbb\filesystem\filesystem; class extension_manager extends manager { /** - * @var manager + * @var ext_manager */ protected $extension_manager; @@ -102,7 +102,8 @@ class extension_manager extends manager { if ($this->enable_on_install) { - $io->writeError([['ENABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['ENABLING_EXTENSIONS', [], 1]]); foreach ($packages as $package => $version) { try @@ -111,11 +112,13 @@ class extension_manager extends manager } catch (\phpbb\exception\runtime_exception $e) { - $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]]); } catch (\Exception $e) { - $io->writeError([[$e->getMessage(), [], 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), [], 4]]); } } } @@ -126,7 +129,8 @@ class extension_manager extends manager */ protected function pre_update(array $packages, IOInterface $io = null) { - $io->writeError([['DISABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['DISABLING_EXTENSIONS', [], 1]]); $this->enabled_extensions = []; foreach ($packages as $package => $version) { @@ -140,11 +144,13 @@ class extension_manager extends manager } catch (\phpbb\exception\runtime_exception $e) { - $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]]); } catch (\Exception $e) { - $io->writeError([[$e->getMessage(), [], 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), [], 4]]); } } } @@ -154,7 +160,8 @@ class extension_manager extends manager */ protected function post_update(array $packages, IOInterface $io = null) { - $io->writeError([['ENABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['ENABLING_EXTENSIONS', [], 1]]); foreach ($this->enabled_extensions as $package) { try @@ -163,11 +170,13 @@ class extension_manager extends manager } catch (\phpbb\exception\runtime_exception $e) { - $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]]); } catch (\Exception $e) { - $io->writeError([[$e->getMessage(), [], 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), [], 4]]); } } } @@ -195,7 +204,8 @@ class extension_manager extends manager { if ($this->purge_on_remove) { - $io->writeError([['DISABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['DISABLING_EXTENSIONS', [], 1]]); } foreach ($packages as $package => $version) @@ -216,11 +226,13 @@ class extension_manager extends manager } catch (\phpbb\exception\runtime_exception $e) { - $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), $e->get_parameters(), 4]]); } catch (\Exception $e) { - $io->writeError([[$e->getMessage(), [], 4]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([[$e->getMessage(), [], 4]]); } } } @@ -244,7 +256,8 @@ class extension_manager extends manager if ($this->extension_manager->is_enabled($package)) { $enabled = true; - $io->writeError([['DISABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['DISABLING_EXTENSIONS', [], 1]]); $this->extension_manager->disable($package); } @@ -279,7 +292,8 @@ class extension_manager extends manager { try { - $io->writeError([['ENABLING_EXTENSIONS', [], 1]], true); + /** @psalm-suppress InvalidArgument */ + $io->writeError([['ENABLING_EXTENSIONS', [], 1]]); $this->extension_manager->enable($package); } catch (\Exception $e) diff --git a/phpBB/phpbb/composer/installer.php b/phpBB/phpbb/composer/installer.php index 330540378d..354c7ead28 100644 --- a/phpBB/phpbb/composer/installer.php +++ b/phpBB/phpbb/composer/installer.php @@ -147,11 +147,11 @@ class installer * @param array $packages Packages to install. * Each entry may be a name or an array associating a version constraint to a name * @param array $whitelist White-listed packages (packages that can be installed/updated/removed) - * @param IOInterface|null $io IO object used for the output + * @param io\io_interface|null $io IO object used for the output * * @throws runtime_exception */ - protected function do_install(array $packages, $whitelist, IOInterface $io = null) + protected function do_install(array $packages, $whitelist, io\io_interface $io = null) { if (!$io) { diff --git a/phpBB/phpbb/composer/manager_interface.php b/phpBB/phpbb/composer/manager_interface.php index 0cf6324661..d14abee8bc 100644 --- a/phpBB/phpbb/composer/manager_interface.php +++ b/phpBB/phpbb/composer/manager_interface.php @@ -57,11 +57,11 @@ interface manager_interface /** * Tells whether or not a package is managed by Composer. * - * @param string $packages Package name + * @param string $package Package name * * @return bool */ - public function is_managed($packages); + public function is_managed($package); /** * Returns the list of managed packages for the current type