Skip to content

Commit 56beb0e

Browse files
authored
Show CliDumper source content on last line (#48707)
1 parent 7966308 commit 56beb0e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Illuminate/Foundation/Console/CliDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function dumpWithSource(Data $data)
9494
$output = (string) $this->dump($data, true);
9595
$lines = explode("\n", $output);
9696

97-
$lines[0] .= $this->getDumpSourceContent();
97+
$lines[array_key_last($lines) - 1] .= $this->getDumpSourceContent();
9898

9999
$this->output->write(implode("\n", $lines));
100100

tests/Foundation/Console/CliDumperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testArray()
5555
$output = $this->dump(['string', 1, 1.1, ['string', 1, 1.1]]);
5656

5757
$expected = <<<'EOF'
58-
array:4 [ // app/routes/console.php:18
58+
array:4 [
5959
0 => "string"
6060
1 => 1
6161
2 => 1.1
@@ -64,7 +64,7 @@ public function testArray()
6464
1 => 1
6565
2 => 1.1
6666
]
67-
]
67+
] // app/routes/console.php:18
6868

6969
EOF;
7070

@@ -90,9 +90,9 @@ public function testObject()
9090
$objectId = spl_object_id($user);
9191

9292
$expected = <<<EOF
93-
{#$objectId // app/routes/console.php:18
93+
{#$objectId
9494
+"name": "Guus"
95-
}
95+
} // app/routes/console.php:18
9696
9797
EOF;
9898

0 commit comments

Comments
 (0)