Skip to content

Commit

Permalink
Merge branch '2.3' into 2.7
Browse files Browse the repository at this point in the history
* 2.3:
  [Form] fix #15544 when a collection type attribute "required" is false, "prototype" should too
  updated validators.bg.xlf
  [Security] Enable bcrypt validation and result length tests on all PHP versions
  [Security] Verify if a password encoded with bcrypt is no longer than 72 characters
  [Console] Avoid extra blank lines when rendering exceptions
  [Yaml] do not remove "comments" in scalar blocks
  • Loading branch information
fabpot committed Dec 18, 2015
2 parents 111994f + ee4f872 commit 5e82832
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 38 deletions.
7 changes: 3 additions & 4 deletions Application.php
Expand Up @@ -631,6 +631,8 @@ public function asXml($namespace = null, $asDom = false)
*/
public function renderException($e, $output)
{
$output->writeln('', OutputInterface::VERBOSITY_QUIET);

do {
$title = sprintf(' [%s] ', get_class($e));

Expand All @@ -653,15 +655,14 @@ public function renderException($e, $output)
}
}

$messages = array('', '');
$messages = array();
$messages[] = $emptyLine = $formatter->format(sprintf('<error>%s</error>', str_repeat(' ', $len)));
$messages[] = $formatter->format(sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))));
foreach ($lines as $line) {
$messages[] = $formatter->format(sprintf('<error> %s %s</error>', $line[0], str_repeat(' ', $len - $line[1])));
}
$messages[] = $emptyLine;
$messages[] = '';
$messages[] = '';

$output->writeln($messages, OutputInterface::OUTPUT_RAW);

Expand All @@ -688,14 +689,12 @@ public function renderException($e, $output)
}

$output->writeln('');
$output->writeln('');
}
} while ($e = $e->getPrevious());

if (null !== $this->runningCommand) {
$output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())));
$output->writeln('');
$output->writeln('');
}
}

Expand Down
2 changes: 0 additions & 2 deletions Tests/Fixtures/application_renderexception1.txt
@@ -1,8 +1,6 @@



[InvalidArgumentException]
Command "foo" is not defined.



3 changes: 0 additions & 3 deletions Tests/Fixtures/application_renderexception2.txt
@@ -1,11 +1,8 @@



[InvalidArgumentException]
The "--foo" option does not exist.



list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]


9 changes: 0 additions & 9 deletions Tests/Fixtures/application_renderexception3.txt
@@ -1,27 +1,18 @@



[Exception]
Third exception comment






[Exception]
Second exception comment






[Exception]
First exception <p>this is html</p>



foo3:bar


9 changes: 0 additions & 9 deletions Tests/Fixtures/application_renderexception3decorated.txt
@@ -1,27 +1,18 @@


 
 [Exception] 
 Third exception comment 
 




 
 [Exception] 
 Second exception comment 
 




 
 [Exception] 
 First exception <p>this is html</p> 
 


foo3:bar


2 changes: 0 additions & 2 deletions Tests/Fixtures/application_renderexception4.txt
@@ -1,9 +1,7 @@



[InvalidArgumentException]
Command "foo" is not define
d.



3 changes: 0 additions & 3 deletions Tests/Fixtures/application_renderexception_doublewidth1.txt
@@ -1,11 +1,8 @@



[Exception]
エラーメッセージ



foo


@@ -1,11 +1,8 @@


 
 [Exception] 
 エラーメッセージ 
 


foo


3 changes: 0 additions & 3 deletions Tests/Fixtures/application_renderexception_doublewidth2.txt
@@ -1,12 +1,9 @@



[Exception]
コマンドの実行中にエラーが
発生しました。



foo


0 comments on commit 5e82832

Please sign in to comment.