Write a line with a green OK badge

@param string $message
@param array  $placeholders
162275
public function writeOkLine($message, array $placeholders = [])
    {
        $this->writeBadgeLine(
            $message, $placeholders, 'badge_ok', Color::GREEN, true, true
        );
    }
1186445
static function line($message = '', $newLine = 'after') {
		if($newLine == 'before' || $newLine == 'both') {
			echo PHP_EOL;
		}
		echo self::formatMessage("Error. $message", ['fg-red']);
		if($newLine == 'after' || $newLine == 'both') {
			echo PHP_EOL;
		}
	}
1345580
public static function w($message, $tags = array())
    {
        
		self::singleton()->log(self::WARNING_LEVEL, $message, $tags);
        
    }
79489
final public static function displayAsNotice(string $message, string $exit = "yes")
    {
        $colors = self::getManagerColorInstance();
        echo "\n\n".$colors->getColoredString($message, "yellow", "transparent");
        if ($exit == "yes") {
            exit();
        }
    }
445052
public function replace($string, array $placeholders = [])
    {
        $replacements = [];
        
        foreach ($placeholders as $name => $value) {
            $replacements[sprintf($this->placeholder, $name)] = $value;
        }
        
        return strtr($string, $replacements);
    }
352224
public function format(string $level, string $message, array $context)
    {
        if ($this->formatter !== null)
            return $this->formatter->format($level, $message, $context);

        // Fall back to the logger placeholder filler
        return Logger::fillPlaceholders($message, $context);
    }
42967
public function replacePlaceholders($message, $values = array())
    {
        $length = count($values);
        $i = 1;
        foreach ($values as $value) {
            if (is_array($value)) {
                $message = preg_replace_callback('/%' . $i . '\{(.*?)\}\{(.*?)\}/', function ($matches) use ($value) {
                    $length = count($value);
                    $list = '';
                    for ($i = 0; $i < $length; $i ++) {
                        $list .= $value[$i];
                        if ($i != ($length - 1)) {
                            if ($i == ($length - 2)) {
                                $list .= $matches[2];
                            } else {
                                $list .= $matches[1];
                            }
                        }
                    }
                    return $list;
                }, $message);
            } else {
                $message = str_replace('%' . $i, $value, $message);
            }
            $i ++;
        }
        return $message;
    }
150297
public static function replacePlaceholders($string, array $replacements) {
    // Make sure the replacements don't have any unneeded newlines.
    $replacements = array_map('trim', $replacements);
    $string = strtr($string, $replacements);
    // Remove noise caused by empty placeholders.
    $lines = explode("\n", $string);
    foreach ($lines as $index => $line) {
      // Remove leading punctuation, excess whitespace.
      $line = trim(preg_replace('/^[-,]+/', '', $line, 1));
      $line = preg_replace('/\s\s+/', ' ', $line);
      $lines[$index] = $line;
    }
    // Remove empty lines.
    $lines = array_filter($lines);

    return implode("\n", $lines);
  }
209289
public static void pass(String message) {
        if (Boolean.getBoolean("visibleassertions.silence") || Boolean.getBoolean("visibleassertions.silence.passes")) {
            return;
        }
        System.out.println("        " + green(TICK_MARK + " " + message));
    }
94481
protected function writeValidity($output, $message, $isValid = null) {
        if ($this->firstValidityWrite) {
            $output->writeln('');
            $this->firstValidityWrite = false;
        }

        if (is_bool($isValid)) {
            $message = sprintf(
                '%s - %s',
                $isValid ? '<fg=green>Valid</>' : '<fg=red>Invalid</>',
                $message
            );
        }

        $output->writeln($message);
    }
237768
private function formatMessage(string $message, array $params): string
    {
        $params = \array_values($params);
        \array_unshift($params, $message);
        
        return \sprintf(...$params);
    }
301817
public function console($messages, $options = ConsoleOutput::VERBOSITY_NORMAL)
    {
        $time = date("Y-m-d H:i:s");

        $wid = 0;
        $processFlag = isset($this->swoole->master_pid) ? '@' : '#';
        $pid = getmypid();
        if (isset($this->swoole->worker_id) && $this->swoole->worker_id >= 0) {
            $wid = $this->swoole->worker_id;
            if ($this->swoole->taskworker) {
                $processFlag = '^'; // taskworker
            } else {
                $processFlag = '*'; // worker
            }
        }
        if (isset($this->swoole->manager_pid) && $this->swoole->manager_pid == $pid) {
            $processFlag = '$'; // manager
        }
        if (isset($this->swoole->master_pid) && $this->swoole->master_pid == $pid) {
            $processFlag = '#'; // master
        }

        $messages = sprintf("[%s %s%d.%d]<info>\tINFO\t</info>%s", $time, $processFlag, $pid, $wid, $messages);

        $this->output->writeln($messages, $options);
    }
294615
public function writeWarnLine($message, array $placeholders = [])
    {
        $this->writeBadgeLine(
            $message, $placeholders, 'badge_warning', Color::RED, true, true
        );
    }
267316
private function overwrite(string $message): void
    {
        if ($this->overwrite) {
            if (!$this->firstRun) {
                if ($this->output instanceof ConsoleSectionOutput) {
                    $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1;
                    $this->output->clear($lines);
                } else {
                    // Erase previous lines
                    if ($this->formatLineCount > 0) {
                        $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message;
                    }

                    // Move the cursor to the beginning of the line and erase the line
                    $message = "\x0D\x1B[2K$message";
                }
            }
        } elseif ($this->step > 0) {
            $message = PHP_EOL.$message;
        }

        $this->firstRun = false;

        $this->output->write($message);
    }
781763
protected function log($level, $message, array $placeholders = [])
    {
        if ($this->_logger) {
            $this->_logger->log($level, $message, $placeholders);
        }

        return $this;
    }
230618
protected function parseMessage(string $message, array $context): string
    {
        return preg_replace_callback('/\\{([\\w\\.]+)\\}/is', static function ($matches) use ($context) {
            $placeholderName = $matches[1];
            if (isset($context[$placeholderName])) {
                return (string)$context[$placeholderName];
            }
            return $matches[0];
        }, $message);
    }
535588
public function replace($text, array $placeholders, $escape = true)
    {
        $args = array();
        
        foreach ($placeholders as $key => $value) {
            $l = $key[0];
            if ($l == $this->escape) {
                $args[$key] = $escape ? htmlspecialchars($value, ENT_QUOTES, 'UTF-8') : $value;
            } elseif ($l == $this->plain) {
                $args[$key] = $value;
            }
        }

        return strtr($text, $args);
    }