Completed
Push — master ( 2824ad...f222c1 )
by Joachim
12:43
created

Payload::createAssertionException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
namespace Loevgaard\AltaPay\Payload;
3
4
abstract class Payload implements PayloadInterface
5
{
6
    /**
7
     * @inheritdoc
8
     */
9
    public function getPayload(): array
10
    {
11 3
        return [];
12
    }
13 3
14
    /**
15
     * This method will remove null values from the input array
16
     *
17
     * @param array $payload
18
     * @return array
19
     */
20
    protected function cleanPayload(array $payload) : array
21
    {
22 6
        foreach ($payload as $k => $v) {
23
            if ($v === null) {
24 6
                unset($payload[$k]);
25 6
            }
26 6
        }
27 4
28 4
        return $payload;
29
    }
30
}
31