Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
48 | private function buildCommand(Config $config, Files $files): string |
||
49 | { |
||
50 | $filesCmd = ''; |
||
51 | foreach ($files as $filename) { |
||
52 | if ($filesCmd !== '') { |
||
53 | $filesCmd .= ' '; |
||
54 | } |
||
55 | $filesCmd .= sprintf('--file="%s"', $filename); |
||
56 | } |
||
57 | |||
58 | return vsprintf( |
||
59 | '"%s" --variable=ON_ERROR_STOP=1 --host=%s --port=%s --username=%s %s %s 2>&1', [ |
||
60 | $this->psql, |
||
61 | $config->host, |
||
62 | $config->port, |
||
63 | $config->username, |
||
64 | $filesCmd, |
||
65 | $config->database, |
||
66 | ] |
||
77 |