diff options
author | Alexandre Alapetite <alexandre@alapetite.fr> | 2024-08-01 20:31:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 20:31:40 +0200 |
commit | d2247221bbf23a8fe19f66ea4ad7d0a59ffaa5b4 (patch) | |
tree | f5174c1b1d174cd41dca20f350e1297894e1c6fa /cli | |
parent | b2c8cb74562b2f7cb290abd61ff1b6f35475f23a (diff) | |
download | freshrss-d2247221bbf23a8fe19f66ea4ad7d0a59ffaa5b4.tar.gz freshrss-d2247221bbf23a8fe19f66ea4ad7d0a59ffaa5b4.zip |
Minor update whitespace PHPCS rules (#6666)
* Minor update whitespace PHPCS rules
To simplify our configuration, apply more rules, and be clearer about what is added or removed compared with PSR12.
Does not change our current conventions, but just a bit more consistent.
* Forgotten *.phtml
* Sort exclusion patterns + add a few for Extensions repo
* Relaxed some rules
Diffstat (limited to 'cli')
-rw-r--r-- | cli/CliOptionsParser.php | 6 | ||||
-rwxr-xr-x | cli/manipulate.translation.php | 12 | ||||
-rwxr-xr-x | cli/prepare.php | 25 |
3 files changed, 22 insertions, 21 deletions
diff --git a/cli/CliOptionsParser.php b/cli/CliOptionsParser.php index 9fb50a4ff..f0c6bf9a2 100644 --- a/cli/CliOptionsParser.php +++ b/cli/CliOptionsParser.php @@ -136,10 +136,10 @@ abstract class CliOptionsParser { foreach ($userInputs as $input) { preg_match($regex, $input, $matches); - if(!empty($matches['short'])) { + if (!empty($matches['short'])) { $foundAliases = array_merge($foundAliases, str_split($matches['short'])); } - if(!empty($matches['long'])) { + if (!empty($matches['long'])) { $foundAliases[] = $matches['long']; } } @@ -232,7 +232,7 @@ abstract class CliOptionsParser { return implode(' ', $required) . ' ' . implode(' ', $optional); } - private function makeInputRegex() : string { + private function makeInputRegex(): string { $shortWithValues = ''; foreach ($this->options as $option) { if (($option->getValueTaken() === 'required' || $option->getValueTaken() === 'optional') && $option->getShortAlias()) { diff --git a/cli/manipulate.translation.php b/cli/manipulate.translation.php index c0bfd1e36..061af8c15 100755 --- a/cli/manipulate.translation.php +++ b/cli/manipulate.translation.php @@ -38,7 +38,7 @@ $data = new I18nFile(); $i18nData = new I18nData($data->load()); switch ($cliOptions->action) { - case 'add' : + case 'add': if (isset($cliOptions->key) && isset($cliOptions->value) && isset($cliOptions->language)) { $i18nData->addValue($cliOptions->key, $cliOptions->value, $cliOptions->language); } elseif (isset($cliOptions->key) && isset($cliOptions->value)) { @@ -54,7 +54,7 @@ switch ($cliOptions->action) { exit; } break; - case 'delete' : + case 'delete': if (isset($cliOptions->key)) { $i18nData->removeKey($cliOptions->key); } else { @@ -75,9 +75,9 @@ switch ($cliOptions->action) { exit; } break; - case 'format' : + case 'format': break; - case 'ignore' : + case 'ignore': if (isset($cliOptions->language) && isset($cliOptions->key)) { $i18nData->ignore($cliOptions->key, $cliOptions->language, isset($cliOptions->revert)); } else { @@ -85,7 +85,7 @@ switch ($cliOptions->action) { exit; } break; - case 'ignore_unmodified' : + case 'ignore_unmodified': if (isset($cliOptions->language)) { $i18nData->ignore_unmodified($cliOptions->language, isset($cliOptions->revert)); } else { @@ -93,7 +93,7 @@ switch ($cliOptions->action) { exit; } break; - default : + default: manipulateHelp(); exit; } diff --git a/cli/prepare.php b/cli/prepare.php index e587c821a..414b48cd8 100755 --- a/cli/prepare.php +++ b/cli/prepare.php @@ -25,18 +25,19 @@ foreach ($dirs as $dir) { } file_put_contents(DATA_PATH . '/.htaccess', <<<'EOF' - # Apache 2.2 - <IfModule !mod_authz_core.c> - Order Allow,Deny - Deny from all - Satisfy all - </IfModule> - - # Apache 2.4 - <IfModule mod_authz_core.c> - Require all denied - </IfModule> - EOF +# Apache 2.2 +<IfModule !mod_authz_core.c> + Order Allow,Deny + Deny from all + Satisfy all +</IfModule> + +# Apache 2.4 +<IfModule mod_authz_core.c> + Require all denied +</IfModule> + +EOF ); accessRights(); |