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