getWidth() public method

Get the available width of the terminal
public getWidth ( ) : integer
return integer
Ejemplo n.º 1
0
 /**
  * @param int $width
  * @return MenuStyle
  */
 public function setWidth($width)
 {
     $availableWidth = $this->terminal->getWidth() - $this->margin * 2 - $this->padding * 2;
     if ($width >= $availableWidth) {
         $width = $availableWidth;
     }
     $this->width = $width;
     $this->calculateContentWidth();
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function lineBreak()
 {
     echo $this->color->__invoke(str_repeat('─', $this->terminal->getWidth()))->yellow();
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function lineBreak()
 {
     return $this->style(str_repeat("─", $this->terminal->getWidth()), 'yellow');
 }