Skip to content

Fix type hints regressions#4855

Merged
Alkarex merged 1 commit intoFreshRSS:edgefrom
Alkarex:fix-type-regressions
Nov 15, 2022
Merged

Fix type hints regressions#4855
Alkarex merged 1 commit intoFreshRSS:edgefrom
Alkarex:fix-type-regressions

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Nov 15, 2022

Fix regressions from #4561 , which added some hard type hints but without ensuring that the code paths would provide strictly identical class types.

Example:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223
Stack trace:
#0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken()
#1 {main}
  thrown in /var/www/FreshRSS/p/api/greader.php on line 223

I refactored the way we access our configuration to have stricter types, improvement of #4110
More work could be done to simplify the way we work with configurations.

Fix regressions from FreshRSS#4561

Example:

```
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223
Stack trace:
#0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken()
#1 {main}
  thrown in /var/www/FreshRSS/p/api/greader.php on line 223
```

Improvement of FreshRSS#4110
@Alkarex Alkarex added Important 🔥 System care Everything related to system care Bug (confirmed) 🐞 issues that are reproducible labels Nov 15, 2022
@Alkarex Alkarex added this to the 1.21.0 milestone Nov 15, 2022
@Alkarex Alkarex linked an issue Nov 15, 2022 that may be closed by this pull request
@Alkarex
Copy link
Member Author

Alkarex commented Nov 15, 2022

Quick merge to ease testing in #4854

@Alkarex Alkarex merged commit 42eeb40 into FreshRSS:edge Nov 15, 2022
@Alkarex Alkarex deleted the fix-type-regressions branch November 15, 2022 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug (confirmed) 🐞 issues that are reproducible Important 🔥 System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] greader API latest Docker Dev Build

1 participant