Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] progress bar fix #16490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Console] drop TerminalDimensionsProviderInterface
  • Loading branch information
TomasVotruba committed Mar 5, 2016
commit eb8a58d43e3a4963085f84abe723597315476983
11 changes: 5 additions & 6 deletions 11 src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Terminal\TerminalDimensionsProvider;
use Symfony\Component\Console\Terminal\TerminalDimensionsProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
Expand Down Expand Up @@ -69,16 +68,16 @@ class Application
private $defaultCommand;

/**
* @var TerminalDimensionsProviderInterface
* @var TerminalDimensionsProvider
*/
private $terminalDimensionsProvider;

/**
* @param string $name The name of the application
* @param string $version The version of the application
* @param TerminalDimensionsProviderInterface $terminalDimensionsProvider
* @param string $name The name of the application
* @param string $version The version of the application
* @param TerminalDimensionsProvider $terminalDimensionsProvider
*/
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN', TerminalDimensionsProviderInterface $terminalDimensionsProvider = null)
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN', TerminalDimensionsProvider $terminalDimensionsProvider = null)
{
$this->name = $name;
$this->version = $version;
Expand Down
11 changes: 5 additions & 6 deletions 11 src/Symfony/Component/Console/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Terminal\TerminalDimensionsProvider;
use Symfony\Component\Console\Terminal\TerminalDimensionsProviderInterface;

/**
* The ProgressBar provides helpers to display progress output.
Expand Down Expand Up @@ -52,16 +51,16 @@ class ProgressBar
private static $formats;

/**
* @var TerminalDimensionsProviderInterface
* @var TerminalDimensionsProvider
*/
private $terminalDimensionsProvider;

/**
* @param OutputInterface $output An OutputInterface instance
* @param int $max Maximum steps (0 if unknown)
* @param TerminalDimensionsProviderInterface $terminalDimensionsProvider
* @param OutputInterface $output An OutputInterface instance
* @param int $max Maximum steps (0 if unknown)
* @param TerminalDimensionsProvider $terminalDimensionsProvider
*/
public function __construct(OutputInterface $output, $max = 0, TerminalDimensionsProviderInterface $terminalDimensionsProvider = null)
public function __construct(OutputInterface $output, $max = 0, TerminalDimensionsProvider $terminalDimensionsProvider = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@

namespace Symfony\Component\Console\Terminal;

class TerminalDimensionsProvider implements TerminalDimensionsProviderInterface
class TerminalDimensionsProvider
{
/**
* @var int[]
*/
private $terminalDimensions = array();

/**
* {@inheritdoc}
* Tries to figure out the terminal dimensions based on the current environment.
*
* @return int[] Array containing width and height
*/
public function getTerminalDimensions()
{
Expand Down Expand Up @@ -53,23 +55,32 @@ public function getTerminalDimensions()
}

/**
* {@inheritdoc}
* Tries to figure out the terminal width in which this application runs.
*
* @return int|null
*/
public function getTerminalWidth()
{
return $this->getTerminalDimensions()[0];
}

/**
* {@inheritdoc}
* Tries to figure out the terminal height in which this application runs.
*
* @return int|null
*/
public function getTerminalHeight()
{
return $this->getTerminalDimensions()[1];
}

/**
* {@inheritdoc}
* Sets terminal dimensions.
*
* Can be useful to force terminal dimensions for functional tests.
*
* @param int $width
* @param int $height
*/
public function setTerminalDimensions($width, $height)
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Terminal\TerminalDimensionsProvider;
use Symfony\Component\Console\Terminal\TerminalDimensionsProviderInterface;

/**
* @group time-sensitive
Expand Down Expand Up @@ -645,7 +644,7 @@ protected function generateOutput($expected)
}

/**
* @return TerminalDimensionsProviderInterface
* @return TerminalDimensionsProvider
*/
private function createTerminalDimensionsProvider()
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.