Passed
Pull Request — master (#93)
by Maximilian
02:52
created

PropertyHelper::checkNullValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Helper;
4
5
/**
6
 * This helper class simplifies the property handling.
7
 *
8
 * @author Maximilian Beckers <[email protected]>
9
 */
10
class PropertyHelper
11
{
12
    /**
13
     * @param array $data
14
     * @param string $key
15
     *
16
     * @return string|null
17
     */
18 46
    public static function checkNullValue(array $data, string $key)
19
    {
20 46
        return isset($data[$key]) ? $data[$key] : null;
21
    }
22
}