8000 [Console] fixed a PHP notice when there is no function · symfony/symfony@ddb4735 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit ddb4735

Browse files
committed
[Console] fixed a PHP notice when there is no function
1 parent 6a13826 commit ddb4735

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,11 @@ protected function doRenderException(\Exception $e, OutputInterface $output)
809809
for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
810810
$class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
811811
$type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
812-
$function = $trace[$i]['function'];
812+
$function = isset($trace[$i]['function']) ? $trace[$i]['function'] : '';
813813
$file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
814814
$line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
815815

816-
$output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
816+
$output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
817817
}
818818

819819
$output->writeln('', OutputInterface::VERBOSITY_QUIET);

0 commit comments

Comments
 (0)
0