Skip to content

Commit 58b4f88

Browse files
Merge branch '4.0'
* 4.0: Fix tests PropertyInfo\DoctrineExtractor - There is bug when indexBy is meta key Fix PercentType error rendering. [minor] SCA [Cache] Inline some hot function calls fixed Silex project's URL fixed deprecations in tests fixed Twig URL [Cache] Add missing `@internal` tag on ProxyTrait fix formatting arguments in plaintext format Fix PSR exception context key Don't assume that file binary exists on *nix OS Fix that ESI/SSI processing can turn a \"private\" response \"public\" [Form] Fixed trimming choice values fix rendering exception stack traces [Routing] Fix loading multiple class annotations for invokable classes
2 parents 1d00452 + 28980aa commit 58b4f88

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function getInputOptionData(InputOption $option)
121121
{
122122
return array(
123123
'name' => '--'.$option->getName(),
124-
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
124+
'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '',
125125
'accept_value' => $option->acceptValue(),
126126
'is_value_required' => $option->isValueRequired(),
127127
'is_multiple' => $option->isArray(),

Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function describeInputOption(InputOption $option, array $options = arr
7070
{
7171
$name = '--'.$option->getName();
7272
if ($option->getShortcut()) {
73-
$name .= '|-'.implode('|-', explode('|', $option->getShortcut())).'';
73+
$name .= '|-'.str_replace('|', '|-', $option->getShortcut()).'';
7474
}
7575

7676
$this->write(

Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private function getInputOptionDocument(InputOption $option): \DOMDocument
218218
$pos = strpos($option->getShortcut(), '|');
219219
if (false !== $pos) {
220220
$objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
221-
$objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut())));
221+
$objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut()));
222222
} else {
223223
$objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
224224
}

EventListener/ErrorListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public function onConsoleError(ConsoleErrorEvent $event)
4040
$error = $event->getError();
4141

4242
if (!$inputString = $this->getInputString($event)) {
43-
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => $error->getMessage()));
43+
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => $error->getMessage()));
4444
}
4545

46-
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
46+
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
4747
}
4848

4949
public function onConsoleTerminate(ConsoleTerminateEvent $event)

Input/InputOption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function getDescription()
195195
*
196196
* @return bool
197197
*/
198-
public function equals(InputOption $option)
198+
public function equals(self $option)
199199
{
200200
return $option->getName() === $this->getName()
201201
&& $option->getShortcut() === $this->getShortcut()

Tests/EventListener/ErrorListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testOnConsoleError()
3434
$logger
3535
->expects($this->once())
3636
->method('error')
37-
->with('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
37+
->with('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
3838
;
3939

4040
$listener = new ErrorListener($logger);
@@ -49,7 +49,7 @@ public function testOnConsoleErrorWithNoCommandAndNoInputString()
4949
$logger
5050
->expects($this->once())
5151
->method('error')
52-
->with('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => 'An error occurred'))
52+
->with('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => 'An error occurred'))
5353
;
5454

5555
$listener = new ErrorListener($logger);

0 commit comments

Comments
 (0)