| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | 3 | public static function updateRecords(string $tableName, array $records, string $type): Request |
|
| 45 | { |
||
| 46 | 3 | Assert::that($tableName) |
|
| 47 | 3 | ->notEmpty(); |
|
| 48 | 3 | Assert::thatAll($records) |
|
| 49 | 3 | ->keyExists('fields') |
|
| 50 | ->keyExists('id'); |
||
| 51 | 2 | Assert::that(strtoupper($type)) |
|
| 52 | 2 | ->inArray(['PUT', 'PATCH']); |
|
| 53 | |||
| 54 | return new self( |
||
| 55 | 2 | strtoupper($type), |
|
| 56 | $tableName, |
||
| 57 | 2 | [ |
|
| 58 | 'Content-Type' => 'application/json', |
||
| 59 | 2 | ], |
|
| 60 | json_encode( |
||
| 61 | [ |
||
| 62 | 'records' => $records |
||
| 63 | ] |
||
| 68 |