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

PropertyHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 11
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkNullValue() 0 3 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
}