Conditions | 2 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2.003 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 42 | public function createSubscriberList( |
|
29 | string $listName, |
||
30 | string $description = '', |
||
31 | array $customFieldsWithValues = [] |
||
32 | ): \stdClass { |
||
33 | 42 | $getParameters = []; |
|
34 | 12 | $postParameters = [ |
|
35 | 42 | 'name' => $listName, |
|
36 | 'description' => $description ?: null, |
||
37 | 42 | 'custom_fields' => $customFieldsWithValues |
|
38 | ]; |
||
39 | |||
40 | 30 | $postParameters = array_filter($postParameters, function ($value) { |
|
41 | 42 | return $value !== null; |
|
42 | 42 | }); |
|
43 | 42 | $response = $this->processRequest($getParameters, $postParameters); |
|
44 | 7 | return $response; |
|
45 | } |
||
55 |