You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The documentation says that you can create multicolored strings by embedding a CLI::color within a CLI::color. However, when you changes the position of the embedded CLI::color, some of the text becomes uncolored.
CodeIgniter 4 version
dev-develop, possibly all releases too
Affected module(s)
CLI library
Expected behavior, and steps to reproduce if appropriate
Create a simple PHP script
require__DIR__ . '/vendor/autoload.php';
define('ENVIRONMENT', 'development'); // This is needed for the new function `hasColorSupport`useCodeIgniter\CLI\CLI;
echoCLI::color('yellow ' . CLI::color('green', 'green'), 'yellow');
This script will give the expected output:
Reversing however the position will give a different output:
require__DIR__ . '/vendor/autoload.php';
define('ENVIRONMENT', 'development'); // This is needed for the new function `hasColorSupport`useCodeIgniter\CLI\CLI;
echoCLI::color(CLI::color('green', 'green') . ' yellow', 'yellow');
This will give instead:
Testing when the embedded CLI::color is in the middle of two strings:
require__DIR__ . '/vendor/autoload.php';
define('ENVIRONMENT', 'development'); // This is needed for the new function `hasColorSupport`useCodeIgniter\CLI\CLI;
echoCLI::color('yellow ' . CLI::color('green', 'green') . ' yellow', 'yellow');
will give:
It is expected that all scripts will give multi colored strings.
Context
OS: Win10 2004
Web server: CLI
PHP version: PHP 7.4.5
The text was updated successfully, but these errors were encountered:
paulbalandan
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Jun 26, 2020
Describe the bug
The documentation says that you can create multicolored strings by embedding a CLI::color within a CLI::color. However, when you changes the position of the embedded CLI::color, some of the text becomes uncolored.
CodeIgniter 4 version
dev-develop, possibly all releases too
Affected module(s)
CLI library
Expected behavior, and steps to reproduce if appropriate
This script will give the expected output:
Reversing however the position will give a different output:
This will give instead:
Testing when the embedded CLI::color is in the middle of two strings:
will give:
Context
The text was updated successfully, but these errors were encountered: