Skip to content
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

symfony/console --no-ansi option removed but present in the logic #41531

Closed
yaroslav-spryker opened this issue Jun 3, 2021 · 1 comment
Closed

Comments

@yaroslav-spryker
Copy link

Symfony version(s) affected: 5.3

Description
In the 5.3 version of the symfony/console we do not have the declaration of --no-ansi parameter anymore
https://github.com/symfony/console/blob/5.3/Application.php#L1039

BUT we have the logic with the check
https://github.com/symfony/console/blob/5.3/Application.php#L885
And in several places of this file as well.
Seems to be a bug or the code needs to be cleaned up.

How to reproduce
Execute the code similar to below with getting this option value
$userOptions['colors'] = $this->options['no-colors'] || $input->getOption('no-ansi') ? false : $config['settings']['colors'];

Possible Solution
To return back the definition of --no-ansi parameter to the
Application:: getDefaultInputDefinition()

@dereuromark
Copy link

dereuromark commented Jun 3, 2021

Codeception/Codeception#6216 had the same issue it seems, and they refactored their code.
But any tag before that one, and also any library that still relies on the 5.2 way seem to break now still.

Codeception PHP Testing Framework v4.1.21
Powered by PHPUnit 9.5.4 by Sebastian Bergmann and contributors.
Running with seed: 
                                        
  The "no-ansi" option does not exist.  
                                        
fixtures [--no-colors] [--silent] [--steps] [-d|--debug] [--no-exit] [-s|--skip SKIP] [-g|--group GROUP] [-x|--skip-group SKIP-GROUP] [--env ENV] [--seed SEED]

I agree that we should get some shimming back, so that the existing and currently working --no-ansi config also works in 5.3+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants