Skip to content
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

PHPStan level 9 for ./p/ and lib_rss.php #5049

Merged
merged 1 commit into from
Jan 29, 2023
Merged

Conversation

Alkarex
Copy link
Member

@Alkarex Alkarex commented Jan 28, 2023

And app/FreshRSS.php.
Contributes to #4112 (addresses 146 level-6 errors)
Refactored greader.php as a class with private functions.

And app/FreshRSS.php
Contributes to FreshRSS#4112
@Alkarex Alkarex added the System care Everything related to the system care label Jan 28, 2023
@Alkarex Alkarex added this to the 1.21.0 milestone Jan 28, 2023
@@ -17,10 +17,14 @@ class FreshRSS_Entry extends Minz_Model {
*/
private $guid;

/** @var string */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you add the type directly in the property definition?

Copy link
Member Author

@Alkarex Alkarex Jan 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require PHP 7.4+: https://php.net/language.types.declarations

With PHP 7.2 (which we support at the moment #4848 ): PHP Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in ./app/Models/Entry.php on line 18

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's come back to it in a few months #3321 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting reading; there are several details I did not know (e.g. about uninitialized properties) https://wiki.php.net/rfc/typed_properties_v2

@Alkarex Alkarex merged commit 4f316b2 into FreshRSS:edge Jan 29, 2023
@Alkarex Alkarex deleted the phpstan-9-p branch January 29, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
System care Everything related to the system care
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants