Skip to content

Commit 8c74725

Browse files
committed
Improve ternary CS
1 parent c98d6e4 commit 8c74725

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/ExtensionInstaller.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
160160
$package_dir = $this->getInstallPath($target);
161161

162162
// restore persistent files
163-
$persistent_files = !empty($extra['roundcube']['persistent-files']) ? $extra['roundcube']['persistent-files'] : ['config.inc.php'];
163+
$persistent_files = !empty($extra['roundcube']['persistent-files'])
164+
? $extra['roundcube']['persistent-files']
165+
: ['config.inc.php'];
164166
foreach ($persistent_files as $file) {
165167
$path = $temp_dir . \DIRECTORY_SEPARATOR . $file;
166168
if (is_readable($path)) {

src/PluginInstaller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ protected function confirmInstall($package_name)
2626

2727
protected function getConfig($package_name, $config, $add)
2828
{
29-
$cur_config = !empty($config['plugins']) ? ((array) $config['plugins']) : [];
29+
$cur_config = !empty($config['plugins'])
30+
? ((array) $config['plugins'])
31+
: [];
3032
$new_config = $cur_config;
3133

3234
if ($add && !in_array($package_name, $new_config, true)) {
@@ -36,7 +38,9 @@ protected function getConfig($package_name, $config, $add)
3638
}
3739

3840
if ($new_config !== $cur_config) {
39-
$config_val = count($new_config) > 0 ? "[\n\t'" . implode("',\n\t'", $new_config) . "',\n];" : '[];';
41+
$config_val = count($new_config) > 0
42+
? "[\n\t'" . implode("',\n\t'", $new_config) . "',\n];"
43+
: '[];';
4044
$result = ['plugins', $config_val];
4145
} else {
4246
$result = false;

src/SkinInstaller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ protected function confirmInstall($package_name)
2626

2727
protected function getConfig($package_name, $config, $add)
2828
{
29-
$cur_config = !empty($config['skin']) ? $config['skin'] : null;
29+
$cur_config = !empty($config['skin'])
30+
? $config['skin']
31+
: null;
3032
$new_config = $cur_config;
3133

3234
if ($add && $new_config !== $package_name) {
@@ -36,7 +38,9 @@ protected function getConfig($package_name, $config, $add)
3638
}
3739

3840
if ($new_config !== $cur_config) {
39-
$config_val = !empty($new_config) ? "'{$new_config}';" : null;
41+
$config_val = !empty($new_config)
42+
? "'{$new_config}';"
43+
: null;
4044
$result = ['skin', $config_val];
4145
} else {
4246
$result = false;

0 commit comments

Comments
 (0)