Symfony\Component\Console\Application::getTerminalDimensions PHP Method

getTerminalDimensions() public method

Tries to figure out the terminal dimensions based on the current environment.
Deprecation: since version 3.2, to be removed in 4.0. Create a Terminal instance instead.
public getTerminalDimensions ( ) : array
return array Array containing width and height
    public function getTerminalDimensions()
    {
        @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED);
        return array($this->terminal->getWidth(), $this->terminal->getHeight());
    }

Usage Example

 /**
  * ConsoleApplication constructor.
  *
  * ><p>**Note:** you'll have to configure the IO channels (ex. calling {@see setupStandardIO}) before running the
  * application.
  *
  * @param ConsoleIO         $io
  * @param ConsoleSettings   $settings
  * @param SymfonyConsole    $console
  * @param InjectorInterface $injector
  */
 function __construct(ConsoleIO $io, ConsoleSettings $settings, SymfonyConsole $console, InjectorInterface $injector)
 {
     $this->io = $io;
     $this->console = $console;
     $this->injector = $injector;
     $this->settings = $settings;
     $console->setAutoExit(false);
     $io->terminalSize($console->getTerminalDimensions());
 }
All Usage Examples Of Symfony\Component\Console\Application::getTerminalDimensions