Merged
Conversation
This class has not been maintained for a while. Only a subset of our configuration properties are there, and some code is not relevant anymore. Furthermore, it is relying exclusively on dynamically invoked functions, making it challenging to maintain, in particular to find out what is used and what is not, what is handled and what is not. It is not well suited for changes in data formats, which have been handled in the Context class instead. It is also not able to handle configuration properties that are missing. It is the class with most errors for PHPStan level 6 (179 errors). It is also making intense use of is_callable and call_user_func_array, which are performance killers. Should the need arrise again to perform validation of our internal configuration files, I suggest an implementation with the opposite approach, namely driven by our code instead of driven by the data. In summary, at the moment, this class is costly, while not offering many guarantees.
Alkarex
commented
Apr 2, 2023
lib/Minz/Configuration.php
Outdated
Comment on lines
-94
to
-111
| /** | ||
| * List of enabled extensions. | ||
| */ | ||
| private $extensions_enabled = []; | ||
|
|
||
| public function removeExtension($ext_name) { | ||
| unset($this->extensions_enabled[$ext_name]); | ||
| $legacyKey = array_search($ext_name, $this->extensions_enabled, true); | ||
| if ($legacyKey !== false) { //Legacy format FreshRSS < 1.11.1 | ||
| unset($this->extensions_enabled[$legacyKey]); | ||
| } | ||
| } | ||
| public function addExtension($ext_name) { | ||
| if (!isset($this->extensions_enabled[$ext_name])) { | ||
| $this->extensions_enabled[$ext_name] = true; | ||
| } | ||
| } | ||
|
|
ColonelMoutarde
approved these changes
Apr 5, 2023
Alkarex
added a commit
to Alkarex/FreshRSS
that referenced
this pull request
Apr 16, 2023
Add interface to replace removed class from FreshRSS#5251
Alkarex
added a commit
that referenced
this pull request
Apr 17, 2023
* Complete PHPStan Level 6 Fix #4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from #5251 * A few more PHPStan Level 7 preparations * A few last details
Alkarex
commented
Apr 19, 2023
Comment on lines
-104
to
-105
| if ($value instanceof FreshRSS_UserQuery) { | ||
| $data['queries'][] = $value->toArray(); |
Member
Author
There was a problem hiding this comment.
This magic call was forgotten. Fixed in #5318
4 tasks
Inverle
reviewed
Sep 20, 2025
Comment on lines
-85
to
-88
| $languages = Minz_Translate::availableLanguages(); | ||
| if (!in_array($value, $languages)) { | ||
| $value = 'en'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This class has not been maintained for a while. Only a subset of our configuration properties are there, and some code is not relevant anymore. Furthermore, it is relying exclusively on dynamically invoked functions, making it challenging to maintain, in particular to find out what is used and what is not, what is handled and what is not. It is not well suited for changes in data formats, which have been handled in the Context class instead. It is also not able to handle configuration properties that are missing. It is the class with most errors for PHPStan level 6 (179 errors). It is also making intense use of is_callable and call_user_func_array, which are performance killers.
Should the need arise again to perform validation of our internal configuration files, I suggest an implementation with the opposite approach, namely driven by our code instead of driven by the data.
In summary, at the moment, this class is costly, while not offering many guarantees.
Contributes to #4112