-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
refactor: global variables removal #10474
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10474 +/- ##
==========================================
- Coverage 49.54% 49.30% -0.24%
==========================================
Files 67 76 +9
Lines 20650 21838 +1188
Branches 4980 5231 +251
==========================================
+ Hits 10231 10768 +537
- Misses 9131 9750 +619
- Partials 1288 1320 +32 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me, thank you!
What
The goal is to get rid of the global variables as suggested by the various 'Todo' in the code, to limit side effects.
These will be accessed through
$request_ref
:$admin
$styles
$initjs
$cc
$bodyabout
About
$lc
and$country
I'm not sure if I it's a good idea. For a part I can easily apply the same thing as for the other ones, because it's just a matter of putting them in therequest_ref
(in the .pl cgi). But for the rest, they are used at a very nested level in the call stack. I'd have to add one or two params to many functions to get to them, and where they are called also. It's not unfeasible though.