for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace AlecRabbit\ConsoleColour;
use AlecRabbit\ConsoleColour\Core\AbstractColorSupportingTerminal;
use AlecRabbit\ConsoleColour\Core\Contracts\TerminalInterface;
/**
* Class Terminal
* @author AlecRabbit
*/
class Terminal extends AbstractColorSupportingTerminal implements TerminalInterface
{
/** {@inheritdoc} */
public function width(bool $recheck = false): int
if (null !== static::$width && true !== $recheck) {
return static::$width;
}
return
static::$width = $this->getWidth();
public function height(bool $recheck = false): int
if (null !== static::$height && true !== $recheck) {
return static::$height;
static::$height = $this->getHeight();
public function supports256Color(bool $recheck = false): bool
if (null !== static::$supports256Color && true !== $recheck) {
return static::$supports256Color;
static::$supports256Color = $this->check256ColorSupport();
public function supportsColor(bool $recheck = false): bool
if (null !== static::$supportsColor && true !== $recheck) {
return static::$supportsColor;
static::$supportsColor = $this->hasColorSupport();
public function setTitle(string $title): void
echo "\033]0;{$title}\007"; // bash echo -e "\033]0;$@\007"