-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unified Cli renderer options incompatible with Main renderer options. #60
Comments
Feel very free to change that as you like. We can do a new version number that indicates that it is incompatible. |
See my suggestion #61 |
I wonder if the constructor can be changed from public function __construct(array $options = [])
{
parent::__construct();
$this->setOptions($this->subOptions);
$this->setOptions($options);
} to public function __construct(array $options = [])
{
parent::__construct($options);
} since the subOptions are empty in InlineCli |
See my comment at #61 (comment) subOptions is currently empty, but meant to declare default values for the subRenderer, other than the options of MainRenderer. |
I still wonder then, why the constructor has the parameter, if setOptions should be used. |
Stop wondering, your thoughts are right. The constructor of MainRendererAbstract also uses setOptions. public function __construct(array $options = [])
{
parent::__construct();
$this->setOptions($this->subOptions);
$this->setOptions($options);
} could probably be shortened to: public function __construct(array $options = [])
{
parent::__construct($this->subOptions);
$this->setOptions($options);
// Or switch $this->subOptions and $options.
} |
It makes sense to set $options at last. Otherwise you can't override the default subOptions. |
Done. Merge #61 |
The UnifiedCli renderer has option
cliColor
whose only valid value issimple
$this->options['cliColor'] == 'simple'
The Main renderer has the following options:
Option
cliColor
should be of type boolean and whentrue
the output should be colorized using the colors defined at optionsinsertColors
anddeleteColors
.btw... The comments in the code block above contains typos as well:
cloColor
instead ofcliColor
See
php-diff/lib/jblond/Diff/Renderer/MainRendererAbstract.php
Line 39 in e6812d0
php-diff/lib/jblond/Diff/Renderer/MainRendererAbstract.php
Line 40 in e6812d0
The text was updated successfully, but these errors were encountered: