-
Notifications
You must be signed in to change notification settings - Fork 50
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 Config #182
Refactor Config #182
Conversation
Remove methods mapping method calls to property access
Remove superfluous exportable() method
Add getter for color output Remove superfluous set_color_output() method Add code related to color output on windows to the constructor
Make copyright a readonly property that is initialized in the constructor Remove copyright() method
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.
MSTM, I think it would be better to use camelCase for the property names, but this can wait.
phpdotnet/phd/Config.php
Outdated
/** @var array<string, string> */ | ||
public array $output_format = []; |
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.
Is the change from static to instance properties okay? (not that I think having it static in the first place made a lot of sense).
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.
I think it makes sense that one set of configuration options can be assigned to one object of the class Config and then we just pass the appropriate object when needed.
As far as how Config is used in PhD, this doesn't make much of a difference as only one Config object is used throughout. :-)
I wanted to do this eventually but it makes more sense to do this as part of this PR. |
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.
Let me know if you are happy as if for me to merge it as a rebase or if you want to stilll organise the commits.
I'll leave it up to you to merge it as you want. |
This PR refactors the
Config
class from using an array of options and method calls to access these to mostly using object properties. Probably best reviewed commit by commit.