Skip to content

Commit 972870f

Browse files
authored
fix(framework): handle reflection in config show command (#1211)
1 parent 6579f35 commit 972870f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Tempest/Framework/Commands/ConfigShowCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ private function formatForJson(mixed $value, int $depth = 0): mixed
157157
return '@...';
158158
}
159159

160+
if ($value instanceof ClassReflector) {
161+
return [
162+
'@type' => $value->getName(),
163+
];
164+
}
165+
160166
if (is_object($value)) {
161167
$result = [
162168
'@type' => $value::class,

tests/Integration/Framework/Commands/ConfigShowCommandTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
*/
1212
final class ConfigShowCommandTest extends FrameworkIntegrationTestCase
1313
{
14+
public function test_it_shows_config_without_params(): void
15+
{
16+
$this->console
17+
->call('config:show')
18+
->assertJson();
19+
}
20+
1421
public function test_it_shows_config_in_json_format(): void
1522
{
1623
$this->console

0 commit comments

Comments
 (0)