| Conditions | 3 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 42 | public function spamCheck( |
|
| 30 | string $subject, |
||
| 31 | string $content, |
||
| 32 | string $fromEmail = '', |
||
| 33 | string $fromName = '' |
||
| 34 | ): \stdClass { |
||
| 35 | 42 | $getParameters = []; |
|
| 36 | 12 | $postParameters = [ |
|
| 37 | 42 | 'subject' => $subject, |
|
| 38 | 42 | 'html' => $content, |
|
| 39 | 'from' => $fromEmail ?: null, |
||
| 40 | 'from_name' => $fromName ?: null |
||
| 41 | ]; |
||
| 42 | |||
| 43 | 30 | $postParameters = array_filter($postParameters, function ($value) { |
|
| 44 | 42 | return $value !== null; |
|
| 45 | 42 | }); |
|
| 46 | 42 | $response = $this->processRequest($getParameters, $postParameters); |
|
| 47 | 7 | return $response; |
|
| 48 | } |
||
| 58 |