File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -29,35 +29,33 @@ class DumpServerCommand extends Command
29
29
*/
30
30
protected $ description = 'Start the dump server to collect dump information ' ;
31
31
32
- /** @var DumpServer */
33
- private $ server ;
34
-
35
32
/**
36
- * @var \Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface[]
33
+ * @var \Symfony\Component\VarDumper\Server\DumpServer
37
34
*/
38
- private $ descriptors ;
35
+ private $ server ;
39
36
40
37
public function __construct (DumpServer $ server )
41
38
{
42
39
$ this ->server = $ server ;
43
40
44
- $ this ->descriptors = [
45
- 'cli ' => new CliDescriptor (new CliDumper ()),
46
- 'html ' => new HtmlDescriptor (new HtmlDumper ()),
47
- ];
48
-
49
41
parent ::__construct ();
50
42
}
51
43
52
44
public function handle ()
53
45
{
54
- $ io = new SymfonyStyle ($ this ->input , $ this ->output );
55
- $ format = $ this ->option ('format ' );
56
-
57
- if (! $ descriptor = $ this ->descriptors [$ format ] ?? null ) {
58
- throw new InvalidArgumentException (sprintf ('Unsupported format "%s". ' , $ format ));
46
+ switch ($ format = $ this ->option ('format ' )) {
47
+ case 'cli ' :
48
+ $ descriptor = new CliDescriptor (new CliDumper );
49
+ break ;
50
+ case 'html ' :
51
+ $ descriptor = new HtmlDescriptor (new HtmlDumper );
52
+ break ;
53
+ default :
54
+ throw new InvalidArgumentException (sprintf ('Unsupported format "%s". ' , $ format ));
59
55
}
60
56
57
+ $ io = new SymfonyStyle ($ this ->input , $ this ->output );
58
+
61
59
$ errorIo = $ io ->getErrorStyle ();
62
60
$ errorIo ->title ('Laravel Var Dump Server ' );
63
61
You can’t perform that action at this time.
0 commit comments