/var/www/vhosts/ihelp.ro/httpdocs/vendor/psy/psysh/src/Readline/Hoa
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/psy/psysh/src/Readline/Hoa/ConsoleOutput.php (5357B)
_output = $output;
return;
}
/**
* Get the real output stream.
*/
public function getStream(): StreamOut
{
return $this->_output;
}
/**
* Write n characters.
*/
public function write(string $string, int $length)
{
if (0 > $length) {
throw new ConsoleException('Length must be greater than 0, given %d.', 0, $length);
}
$out = \substr($string, 0, $length);
if (true === $this->isMultiplexerConsidered()) {
if (true === Console::isTmuxRunning()) {
$out =
"\033Ptmux;".
\str_replace("\033", "\033\033", $out).
"\033\\";
}
$length = \strlen($out);
}
if (null === $this->_output) {
echo $out;
} else {
$this->_output->write($out, $length);
}
}
/**
* Write a string.
*/
public function writeString(string $string)
{
$string = (string) $string;
return $this->write($string, \strlen($string));
}
/**
* Write a character.
*/
public function writeCharacter(string $character)
{
return $this->write((string) $character[0], 1);
}
/**
* Write a boolean.
*/
public function writeBoolean(bool $boolean)
{
return $this->write(((bool) $boolean) ? '1' : '0', 1);
}
/**
* Write an integer.
*/
public function writeInteger(int $integer)
{
$integer = (string) (int) $integer;
return $this->write($integer, \strlen($integer));
}
/**
* Write a float.
*/
public function writeFloat(float $float)
{
$float = (string) (float) $float;
return $this->write($float, \strlen($float));
}
/**
* Write an array.
*/
public function writeArray(array $array)
{
$array = \var_export($array, true);
return $this->write($array, \strlen($array));
}
/**
* Write a line.
*/
public function writeLine(string $line)
{
if (false === $n = \strpos($line, "\n")) {
return $this->write($line."\n", \strlen($line) + 1);
}
++$n;
return $this->write(\substr($line, 0, $n), $n);
}
/**
* Write all, i.e. as much as possible.
*/
public function writeAll(string $string)
{
return $this->write($string ?? '', \strlen($string ?? ''));
}
/**
* Truncate a stream to a given length.
*/
public function truncate(int $size): bool
{
return false;
}
/**
* Consider the multiplexer (if running) while writing on the output.
*/
public function considerMultiplexer(bool $consider): bool
{
$old = $this->_considerMultiplexer;
$this->_considerMultiplexer = $consider;
return $old;
}
/**
* Check whether the multiplexer must be considered or not.
*/
public function isMultiplexerConsidered(): bool
{
return $this->_considerMultiplexer;
}
}