Skip to content

Commit

Permalink
trim(): Argument #1 () must be of type string, bool given
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Apr 24, 2023
1 parent 930de43 commit 90f21e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public static function hasSttyAvailable(): bool
private static function initDimensions()
{
if ('\\' === \DIRECTORY_SEPARATOR) {
if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
$ansicon = getenv('ANSICON');
if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) {
// extract [w, H] from "wxh (WxH)"
// or [w, h] from "wxh"
self::$width = (int) $matches[1];
Expand Down

0 comments on commit 90f21e2

Please sign in to comment.