PhpSchool\CliMenu\Terminal\TerminalInterface::getWidth PHP Method

getWidth() public method

Get the available width of the terminal
public getWidth ( ) : integer
return integer
    public function getWidth();

Usage Example

Exemplo 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;
 }
All Usage Examples Of PhpSchool\CliMenu\Terminal\TerminalInterface::getWidth