Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function handle() |
||
14 | { |
||
15 | if (! $this->isAllowedToRun()) { |
||
16 | $this->error('This command can only run if the environment variable `ALLOW_DD_COMMAND` is set to `true` or in local environment'); |
||
17 | |||
18 | return; |
||
19 | } |
||
20 | |||
21 | return collect($this->argument('code')) |
||
22 | ->map(function (string $command) { |
||
23 | return rtrim($command, ';'); |
||
24 | }) |
||
25 | ->map(function (string $sanitizedCommand) { |
||
26 | return eval("dump({$sanitizedCommand});"); |
||
27 | }) |
||
28 | ->implode(PHP_EOL); |
||
29 | } |
||
30 | |||
40 |