Skip to content

Commit 2650a53

Browse files
authored
Merge pull request #109 from morozov/issues/108
Do not display the "from" section for the first exception trace entry
2 parents 5a902ba + f8a4493 commit 2650a53

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: php
2+
dist: precise
23
matrix:
34
include:
45
- php: 5.3

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"require-dev": {
2424
"corneltek/phpunit-testmore": "dev-master",
2525
"satooshi/php-coveralls": "^1",
26-
"phpunit/phpunit": "^5.7"
26+
"phpunit/phpunit": "^4.8 || ^5.7"
2727
},
2828
"license": "MIT",
2929
"authors": [

src/ExceptionPrinter/DevelopmentExceptionPrinter.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,23 @@ public function dumpTrace(Exception $e)
9797

9898
$argDesc = $this->dumpArgs($entry['args']);
9999

100-
$this->logger->info(sprintf(" %d) %s%s%s(%s)", $idx, @$entry['class'], @$entry['type'], $entry['function'], $argDesc));
101-
$this->logger->info(sprintf(" from %s: %d", $entry['file'], $entry['line']));
100+
$this->logger->info(sprintf(
101+
" %d) %s%s%s(%s)",
102+
$idx + 1,
103+
@$entry['class'],
104+
@$entry['type'],
105+
$entry['function'],
106+
$argDesc
107+
));
108+
109+
if (isset($entry['file'], $entry['line'])) {
110+
$this->logger->info(sprintf(
111+
" from %s: %d",
112+
$entry['file'],
113+
$entry['line']
114+
));
115+
}
116+
102117
$this->logger->newline();
103118
}
104119
$this->logger->newline();
@@ -141,7 +156,7 @@ public function dumpBrief(Exception $e)
141156
}
142157
}
143158

144-
public function dump(Exception $e)
159+
public function dump(Exception $e)
145160
{
146161
$this->dumpBrief($e);
147162
$this->dumpCodeBlock($e);

0 commit comments

Comments
 (0)