Enforce PHP #[Deprecated] with PHPStan (#406)

Taking advantage of https://github.com/FreshRSS/FreshRSS/pull/8325
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2026-01-08 09:10:18 +01:00
1 parent 7ea661b41a
commit bba5a384fc
5 files changed
+53 -3

No files matched your search

+1
View File
@@ -50,6 +50,7 @@
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"phpstan/phpstan": "^2",
"phpstan/phpstan-deprecation-rules": "^2",
"phpstan/phpstan-strict-rules": "^2",
"squizlabs/php_codesniffer": "^4"
},
Generated
+48 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8a6dcc1afea2037b32149736705f192e",
"content-hash": "d60832133308ce3cd2a2b8aa700716f3",
"packages": [],
"packages-dev": [
{
@@ -60,6 +60,53 @@
],
"time": "2025-12-05T10:24:31+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
"reference": "468e02c9176891cc901143da118f09dc9505fc2f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f",
"reference": "468e02c9176891cc901143da118f09dc9505fc2f",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "^2.1.15"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^9.6"
},
"type": "phpstan-extension",
"extra": {
"phpstan": {
"includes": [
"rules.neon"
]
}
},
"autoload": {
"psr-4": {
"PHPStan\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
"support": {
"issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3"
},
"time": "2025-05-14T10:56:57+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
"version": "2.0.7",
+1
View File
@@ -43,4 +43,5 @@ parameters:
ignoreErrors:
- '#Only booleans are allowed in (a negated boolean|a ternary operator condition|an elseif condition|an if condition|&&|\|\|), (bool|false|int(<[0-9, max]+>)?|true|null|\|)+ given.*#'
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
+2 -1
View File
@@ -35,7 +35,8 @@ final class CaptchaExtension extends Minz_Extension {
}
public static function getClientIp(): string {
$ip = checkTrustedIP() ? ($_SERVER['HTTP_X_REAL_IP'] ?? connectionRemoteAddress()) : connectionRemoteAddress();
$ip = FreshRSS_http_Util::checkTrustedIP() ?
($_SERVER['HTTP_X_REAL_IP'] ?? Minz_Request::connectionRemoteAddress()) : Minz_Request::connectionRemoteAddress();
return is_string($ip) ? $ip : '';
}
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "Form Captcha",
"author": "Inverle",
"description": "Protect register/login forms with captcha",
"version": "1.0.2",
"version": "1.0.3",
"entrypoint": "Captcha",
"type": "system"
}