Merge branch '2.8' into 3.0

* 2.8:
  [Console] Fix wrong exceptions being thrown
  Add missing parenthesis in docblock description
  [FrameworkBundle] Remove duplicated code in ContainerDebugCommand
This commit is contained in:
Fabien Potencier 2016-04-28 11:48:42 +02:00
commit dd3e5108b2
4 changed files with 12 additions and 14 deletions

View File

@ -93,25 +93,21 @@ EOF
{
$io = new SymfonyStyle($input, $output);
$this->validateInput($input);
$object = $this->getContainerBuilder();
if ($input->getOption('parameters')) {
$object = $this->getContainerBuilder()->getParameterBag();
$object = $object->getParameterBag();
$options = array();
} elseif ($parameter = $input->getOption('parameter')) {
$object = $this->getContainerBuilder();
$options = array('parameter' => $parameter);
} elseif ($input->getOption('tags')) {
$object = $this->getContainerBuilder();
$options = array('group_by' => 'tags', 'show_private' => $input->getOption('show-private'));
} elseif ($tag = $input->getOption('tag')) {
$object = $this->getContainerBuilder();
$options = array('tag' => $tag, 'show_private' => $input->getOption('show-private'));
} elseif ($name = $input->getArgument('name')) {
$object = $this->getContainerBuilder();
$name = $this->findProperServiceName($input, $io, $object, $name);
$options = array('id' => $name);
} else {
$object = $this->getContainerBuilder();
$options = array('show_private' => $input->getOption('show-private'));
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Output\OutputInterface;
/**
@ -53,7 +55,7 @@ class ProgressIndicator
$indicatorValues = array_values($indicatorValues);
if (2 > count($indicatorValues)) {
throw new \InvalidArgumentException('Must have at least 2 indicator value characters.');
throw new InvalidArgumentException('Must have at least 2 indicator value characters.');
}
$this->format = self::getFormatDefinition($format);
@ -118,7 +120,7 @@ class ProgressIndicator
public function start($message)
{
if ($this->started) {
throw new \LogicException('Progress indicator already started.');
throw new LogicException('Progress indicator already started.');
}
$this->message = $message;
@ -137,7 +139,7 @@ class ProgressIndicator
public function advance()
{
if (!$this->started) {
throw new \LogicException('Progress indicator has not yet been started.');
throw new LogicException('Progress indicator has not yet been started.');
}
if (!$this->output->isDecorated()) {
@ -164,7 +166,7 @@ class ProgressIndicator
public function finish($message)
{
if (!$this->started) {
throw new \LogicException('Progress indicator has not yet been started.');
throw new LogicException('Progress indicator has not yet been started.');
}
$this->message = $message;

View File

@ -162,7 +162,7 @@ class Table
} elseif (isset(self::$styles[$name])) {
$this->columnStyles[$columnIndex] = self::$styles[$name];
} else {
throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
}
return $this;

View File

@ -170,7 +170,7 @@ class RouteCollectionBuilder
/**
* Sets a default value that will be added to all embedded routes (unless that
* default value is already set.
* default value is already set).
*
* @param string $key
* @param mixed $value
@ -186,7 +186,7 @@ class RouteCollectionBuilder
/**
* Sets a requirement that will be added to all embedded routes (unless that
* requirement is already set.
* requirement is already set).
*
* @param string $key
* @param mixed $regex
@ -202,7 +202,7 @@ class RouteCollectionBuilder
/**
* Sets an opiton that will be added to all embedded routes (unless that
* option is already set.
* option is already set).
*
* @param string $key
* @param mixed $value