Conditions | 2 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2.0023 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 28 | public function editSubscriber( |
|
30 | string $email, |
||
31 | string $listHash, |
||
32 | int $subscriberStatus = 0, |
||
33 | array $customFieldsWithValues = [] |
||
34 | ) { |
||
35 | 28 | $getParameters = []; |
|
36 | 8 | $postParameters = [ |
|
37 | 28 | 'email' => $email, |
|
38 | 28 | 'list' => $listHash, |
|
39 | 28 | 'state' => $subscriberStatus, |
|
40 | 'custom_fields' => $customFieldsWithValues ?: null |
||
41 | ]; |
||
42 | |||
43 | 20 | $postParameters = array_filter($postParameters, function ($value) { |
|
44 | 28 | return $value !== null; |
|
45 | 28 | }); |
|
46 | 28 | $this->processRequest($getParameters, $postParameters); |
|
47 | 7 | return null; |
|
48 | } |
||
58 |