Skip to content

Commit 7e08d14

Browse files
authored
1 parent 217976c commit 7e08d14

File tree

11 files changed

+73
-100
lines changed

11 files changed

+73
-100
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"ext-xmlwriter": "*",
5252
"phpstan/phpstan": "^2",
5353
"phpstan/phpstan-strict-rules": "^2",
54-
"squizlabs/php_codesniffer": "^3"
54+
"squizlabs/php_codesniffer": "^4"
5555
},
5656
"scripts": {
5757
"php-lint": "find . -type d -name 'vendor' -prune -o -name '*.php' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null",

composer.lock

Lines changed: 14 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<ruleset name="FreshRSS">
33
<arg name="extensions" value="php,phtml"/>
44
<arg name="tab-width" value="4"/>
5-
<exclude-pattern>./.git/</exclude-pattern>
6-
<exclude-pattern>./data/config.php</exclude-pattern>
7-
<exclude-pattern>./data/update.php</exclude-pattern>
8-
<exclude-pattern>./data/users/*/config.php</exclude-pattern>
9-
<exclude-pattern>./extensions/</exclude-pattern>
10-
<exclude-pattern>./lib/http-conditional.php</exclude-pattern>
11-
<exclude-pattern>./lib/marienfressinaud/</exclude-pattern>
12-
<exclude-pattern>./lib/phpgt/</exclude-pattern>
13-
<exclude-pattern>./lib/phpmailer/</exclude-pattern>
14-
<exclude-pattern>./lib/simplepie/</exclude-pattern>
15-
<exclude-pattern>./node_modules/</exclude-pattern>
16-
<exclude-pattern>./p/scripts/vendor/</exclude-pattern>
17-
<exclude-pattern>./vendor/</exclude-pattern>
5+
<exclude-pattern>/\.git/*</exclude-pattern>
6+
<exclude-pattern>/data/config.php</exclude-pattern>
7+
<exclude-pattern>/data/update.php</exclude-pattern>
8+
<exclude-pattern>/data/users/*/config.php</exclude-pattern>
9+
<exclude-pattern>/(?-i:extensions)/*</exclude-pattern><!-- Case sensitive to allow our Extensions repo -->
10+
<exclude-pattern>/lib/http-conditional.php</exclude-pattern>
11+
<exclude-pattern>/lib/marienfressinaud/</exclude-pattern>
12+
<exclude-pattern>/lib/phpgt/*</exclude-pattern>
13+
<exclude-pattern>/lib/phpmailer/*</exclude-pattern>
14+
<exclude-pattern>/lib/simplepie/*</exclude-pattern>
15+
<exclude-pattern>/node_modules/*</exclude-pattern>
16+
<exclude-pattern>/p/scripts/vendor/*</exclude-pattern>
17+
<exclude-pattern>/vendor/*</exclude-pattern>
1818
<!-- Additional exclusions for Extensions: -->
19-
<exclude-pattern>./symbolic/</exclude-pattern>
20-
<exclude-pattern>./third-party/</exclude-pattern>
21-
<exclude-pattern>./tmp/</exclude-pattern>
19+
<exclude-pattern>/symbolic/*</exclude-pattern>
20+
<exclude-pattern>/third-party/*</exclude-pattern>
21+
<exclude-pattern>/tmp/*</exclude-pattern>
2222
<rule ref="PSR12">
2323
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
2424
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
@@ -33,7 +33,8 @@
3333
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine"/>
3434
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine"/><!-- Consider using PSR12 defaults instead -->
3535
<exclude name="PSR12.Files.FileHeader.IncorrectOrder"/><!-- Consider using PSR12 defaults instead -->
36-
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/><!-- Consider using PSR12 defaults instead -->
36+
<exclude name="PSR12.Files.FileHeader.SpacingAfterDeclareBlock"/><!-- Consider using PSR12 defaults instead -->
37+
<exclude name="PSR12.Files.FileHeader.SpacingAfterTagBlock"/><!-- Consider using PSR12 defaults instead -->
3738
<exclude name="PSR12.Traits.UseDeclaration.MultipleImport"/>
3839
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/><!-- Consider using PSR12 defaults instead -->
3940
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/><!-- Consider using PSR12 defaults instead -->
@@ -45,7 +46,7 @@
4546
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/>
4647
<exclude name="PSR2.Methods.FunctionCallSignature.MultipleArguments"/>
4748
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
48-
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
49+
<exclude name="Squiz.Classes.ValidClassName.NotPascalCase"/>
4950
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
5051
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine"/>
5152
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"/>
@@ -64,7 +65,7 @@
6465
<property name="lineLimit" value="165"/>
6566
<property name="absoluteLineLimit" value="190"/>
6667
</properties>
67-
<exclude-pattern>/app/i18n/*\.php$</exclude-pattern>
68+
<exclude-pattern>/i18n/*\.php$</exclude-pattern>
6869
<exclude-pattern>*\.phtml$</exclude-pattern>
6970
</rule>
7071
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/><!-- Consider using PSR12 defaults instead -->

xExtension-Captcha/Controllers/userController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ public function createAction(): void {
1616
parent::createAction();
1717
}
1818
}
19-

xExtension-Captcha/extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static function loadDependencies(): array {
185185
if ($csp_hosts === 'https://www.google.com') {
186186
// Original js_url injects script from www.gstatic.com therefore this is needed
187187
$csp_hosts .= "/recaptcha/api.js https://www.gstatic.com/recaptcha/";
188-
} else if ($csp_hosts === 'https://js.hcaptcha.com') {
188+
} elseif ($csp_hosts === 'https://js.hcaptcha.com') {
189189
$csp_hosts = 'https://hcaptcha.com https://*.hcaptcha.com';
190190
}
191191
$csp = [

xExtension-ImageProxy/extension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public function handleConfigureAction(): void {
6262
FreshRSS_Context::userConf()->_attribute('image_proxy_url', Minz_Request::paramString('image_proxy_url', plaintext: true) ?: self::PROXY_URL);
6363
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_http', Minz_Request::paramBoolean('image_proxy_scheme_http'));
6464
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_https', Minz_Request::paramBoolean('image_proxy_scheme_https'));
65-
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_default', Minz_Request::paramString('image_proxy_scheme_default', plaintext: true) ?: self::SCHEME_DEFAULT);
65+
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_default',
66+
Minz_Request::paramString('image_proxy_scheme_default', plaintext: true) ?: self::SCHEME_DEFAULT);
6667
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_include', Minz_Request::paramBoolean('image_proxy_scheme_include'));
6768
FreshRSS_Context::userConf()->_attribute('image_proxy_url_encode', Minz_Request::paramBoolean('image_proxy_url_encode'));
6869
FreshRSS_Context::userConf()->save();
@@ -143,7 +144,8 @@ public static function swapUris(string $content): string {
143144
$newSrc = self::getProxyImageUri($src);
144145
/*
145146
Due to the URL change, FreshRSS is not aware of already rendered enclosures.
146-
Adding data-xextension-imageproxy-original-src / srcset ensures that original URLs are present in the content for the renderer check FreshRSS_Entry->containsLink.
147+
Adding data-xextension-imageproxy-original-src / srcset ensures that
148+
original URLs are present in the content for the renderer check FreshRSS_Entry->containsLink.
147149
*/
148150
$img->setAttribute('data-xextension-imageproxy-original-src', $src);
149151
$img->setAttribute('src', $newSrc);

xExtension-WordHighlighter/extension.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
final class WordHighlighterExtension extends Minz_Extension
66
{
7-
const JSON_ENCODE_CONF = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR;
7+
private const JSON_ENCODE_CONF = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR;
88

99
public string $word_highlighter_conf = 'test';
1010
public string $permission_problem = '';
@@ -14,8 +14,7 @@ final class WordHighlighterExtension extends Minz_Extension
1414
public bool $separate_word_search = false;
1515

1616
#[\Override]
17-
public function init(): void
18-
{
17+
public function init(): void {
1918
$this->registerTranslates();
2019

2120
// register CSS for WordHighlighter:
@@ -36,8 +35,7 @@ public function init(): void
3635
}
3736

3837
#[\Override]
39-
public function handleConfigureAction(): void
40-
{
38+
public function handleConfigureAction(): void {
4139
$this->registerTranslates();
4240

4341
$current_user = Minz_Session::paramString('currentUser');
@@ -48,11 +46,9 @@ public function handleConfigureAction(): void
4846
if (!file_exists($configFileJson) && !is_writable($staticPath)) {
4947
$tmpPath = explode(EXTENSIONS_PATH . '/', $staticPath);
5048
$this->permission_problem = $tmpPath[1] . '/';
51-
5249
} elseif (file_exists($configFileJson) && !is_writable($configFileJson)) {
5350
$tmpPath = explode(EXTENSIONS_PATH . '/', $configFileJson);
5451
$this->permission_problem = $tmpPath[1];
55-
5652
} elseif (Minz_Request::isPost()) {
5753
$configWordList = html_entity_decode(Minz_Request::paramString('words_list'));
5854

@@ -85,15 +81,13 @@ public function handleConfigureAction(): void
8581
$this->case_sensitive = (bool) ($confJson['case_sensitive'] ?? false);
8682
$this->separate_word_search = (bool) ($confJson['separate_word_search'] ?? false);
8783
$this->word_highlighter_conf = implode("\n", (array) ($confJson['words'] ?? []));
88-
89-
} catch (Exception $exception) {
84+
} catch (Exception $exception) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
9085
// probably nothing to do needed
9186
}
9287
}
9388
}
9489

95-
private function jsonToJs(string $jsonStr): string
96-
{
90+
private function jsonToJs(string $jsonStr): string {
9791
$js = "window.WordHighlighterConf = " .
9892
$jsonStr . ";\n" .
9993
"window.WordHighlighterConf.enable_logs && console.log('WordHighlighter: loaded user config:', window.WordHighlighterConf);";

0 commit comments

Comments
 (0)