-
-
Notifications
You must be signed in to change notification settings - Fork 1
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: Add KeymanSiteEnvironment #12
base: main
Are you sure you want to change the base?
Conversation
$props = get_class_vars($class); | ||
var_dump($props); | ||
} | ||
} |
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.
Looking ahead to refactoring
and
Will we want additional functions to
- unset a property
- return a boolean if the env var is
''
?
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.
- unset a property
I'd prefer to rewrite how that particular function works. It's suboptimal at present.
- return a boolean if the env var is
''
?
No, if the env var is unsset, then the property value should be NULL
(testable with is_null, isset, isempty etc).
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.
No, if the env var is unsset, then the property value should be NULL ...
I meant for 2. to check when vars are initialized to ''
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.
If it is needed?
_common/KeymanSiteEnvironment.php
Outdated
$props = get_class_vars($class); | ||
foreach($props as $name => $value) { | ||
if (isset($env[$name])) { | ||
self::$instance->$name = $env[$name]; |
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.
Back to draft since this line is giving me errors
Addresses this point from keymnapp/keyman.com#403
TODO: Refactor KeymanHosts?