-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strict_types #5830
Use strict_types #5830
Conversation
@@ -1,5 +1,7 @@ | |||
<?php | |||
|
|||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not make many PRs with partial changes, so let's start by deciding where we should have that in production (pros and cons) and then apply on everything we have decided (and tested!) at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any disadvantages or problems. on the contrary, the code is more robust because it does what it says.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will probably add those lines (it is the right time now, that we have just added PHP 7.4 typed properties), but examples of disadvantages are increased risks of crash in production, and tiny impact on performance (due to additional checks at runtime)...
Let's do that in one go instead of many small PRs. Please add |
Ah, I can see the other change you made was probably to address:
|
There were multiple errors under PHP 8.2 / 8.3. Fixed in 96c0c52 docker run --rm -it -e FRESHRSS_ENV=development -v $PWD:/var/www/FreshRSS freshrss/freshrss:newest bin/composer test |
Many declarations were missing. Also added for phtml files. More errors fixed |
Crashes. Needs more testing. Example:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many crashes. Will you try to run & test this branch @ColonelMoutarde ?
Please let me know when you are done testing & fixing @ColonelMoutarde |
Ok for me ;) |
Are you able to run this branch for all the main functionalities? Just loading the main page:
And there are most likely plenty more |
Another regression fixed #5891 |
@Alwaysin: for CustomJS extension after changing to the new methods, indeed fixes the private method errors. e.g. diff --git a/xExtension-CustomJS/extension.php b/xExtension-CustomJS/extension.php
index db76899..f30e441 100644
--- a/xExtension-CustomJS/extension.php
+++ b/xExtension-CustomJS/extension.php
@@ -4,7 +4,7 @@ class CustomJSExtension extends Minz_Extension {
public function init() {
$this->registerTranslates();
- $current_user = Minz_Session::param('currentUser');
+ $current_user = Minz_Session::paramString('currentUser');
$filename = 'script.' . $current_user . '.js';
$filepath = join_path($this->getPath(), 'static', $filename);
@@ -16,7 +16,7 @@ class CustomJSExtension extends Minz_Extension {
public function handleConfigureAction() {
$this->registerTranslates();
- $current_user = Minz_Session::param('currentUser');
+ $current_user = Minz_Session::paramString('currentUser');
$filename = 'script.' . $current_user . '.js';
$staticPath = join_path($this->getPath(), 'static');
$filepath = join_path($staticPath, $filename);
@@ -28,7 +28,7 @@ class CustomJSExtension extends Minz_Extension {
$tmpPath = explode(EXTENSIONS_PATH . '/', $filepath);
$this->permission_problem = $tmpPath[1];
} else if (Minz_Request::isPost()) {
- $js_rules = html_entity_decode(Minz_Request::param('js-rules', ''));
+ $js_rules = html_entity_decode(Minz_Request::paramString('js-rules', ''));
file_put_contents($filepath, $js_rules);
}
|
@mkorthof PR welcome 👍🏻 |
@@ -1,5 +1,6 @@ | |||
#!/usr/bin/env php | |||
<?php | |||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression for PHP 7, fixed in #5893
Multiple PHP 7 crashes, fixed in #5893 |
Regression from FreshRSS#5830
Another regression with crash in production #5927 |
fix FreshRSS#5928 `susbstr` might return false in PHP7 Regression from FreshRSS#5830
Another crash #5929 |
fix FreshRSS#5934 Regression from FreshRSS#5830
fix FreshRSS#5975 Regression from FreshRSS#5830
Regression #5978 |
Changes proposed in this pull request:
Pull request checklist: