From 8c74725e37e50a6f3b60bf1b5c379ec72d9f0774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 21 Apr 2024 01:17:32 +0200 Subject: [PATCH] Improve ternary CS --- src/ExtensionInstaller.php | 4 +++- src/PluginInstaller.php | 8 ++++++-- src/SkinInstaller.php | 8 ++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ExtensionInstaller.php b/src/ExtensionInstaller.php index c0ebdcf..ac3cb2e 100644 --- a/src/ExtensionInstaller.php +++ b/src/ExtensionInstaller.php @@ -160,7 +160,9 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini $package_dir = $this->getInstallPath($target); // restore persistent files - $persistent_files = !empty($extra['roundcube']['persistent-files']) ? $extra['roundcube']['persistent-files'] : ['config.inc.php']; + $persistent_files = !empty($extra['roundcube']['persistent-files']) + ? $extra['roundcube']['persistent-files'] + : ['config.inc.php']; foreach ($persistent_files as $file) { $path = $temp_dir . \DIRECTORY_SEPARATOR . $file; if (is_readable($path)) { diff --git a/src/PluginInstaller.php b/src/PluginInstaller.php index 6bd2c9f..e09fbe4 100644 --- a/src/PluginInstaller.php +++ b/src/PluginInstaller.php @@ -26,7 +26,9 @@ protected function confirmInstall($package_name) protected function getConfig($package_name, $config, $add) { - $cur_config = !empty($config['plugins']) ? ((array) $config['plugins']) : []; + $cur_config = !empty($config['plugins']) + ? ((array) $config['plugins']) + : []; $new_config = $cur_config; if ($add && !in_array($package_name, $new_config, true)) { @@ -36,7 +38,9 @@ protected function getConfig($package_name, $config, $add) } if ($new_config !== $cur_config) { - $config_val = count($new_config) > 0 ? "[\n\t'" . implode("',\n\t'", $new_config) . "',\n];" : '[];'; + $config_val = count($new_config) > 0 + ? "[\n\t'" . implode("',\n\t'", $new_config) . "',\n];" + : '[];'; $result = ['plugins', $config_val]; } else { $result = false; diff --git a/src/SkinInstaller.php b/src/SkinInstaller.php index 5854bf9..4d9cee5 100644 --- a/src/SkinInstaller.php +++ b/src/SkinInstaller.php @@ -26,7 +26,9 @@ protected function confirmInstall($package_name) protected function getConfig($package_name, $config, $add) { - $cur_config = !empty($config['skin']) ? $config['skin'] : null; + $cur_config = !empty($config['skin']) + ? $config['skin'] + : null; $new_config = $cur_config; if ($add && $new_config !== $package_name) { @@ -36,7 +38,9 @@ protected function getConfig($package_name, $config, $add) } if ($new_config !== $cur_config) { - $config_val = !empty($new_config) ? "'{$new_config}';" : null; + $config_val = !empty($new_config) + ? "'{$new_config}';" + : null; $result = ['skin', $config_val]; } else { $result = false;