| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class DataDump |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param string $table |
||
| 12 | * @param int $maxRowSize |
||
| 13 | * @param string $separator |
||
| 14 | * @param string $insert |
||
| 15 | * @param array $dataRows |
||
| 16 | * @param int $dataSize |
||
| 17 | * @param string $suffix |
||
| 18 | */ |
||
| 19 | public function __construct(public string $table, public int $maxRowSize, |
||
| 20 | public string $separator, public string $insert = '', public array $dataRows = [], |
||
| 21 | public int $dataSize = 0, public string $suffix = '') |
||
| 22 | {} |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param array $row |
||
| 26 | * |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | public function addRow(array $row): void |
||
| 30 | { |
||
| 31 | $dataRow = '(' . implode(",\t", $row) . ')'; |
||
| 32 | $this->dataRows[] = $dataRow; |
||
| 33 | $this->dataSize += strlen($dataRow) + 2; // 2 chars for the separator. |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function limitExceeded(): bool |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function makeQuery(): string |
||
| 56 | } |
||
| 57 | } |
||
| 58 |