Completed
Push — master ( ea24b8...e11a9c )
by Gareth
04:07
created

ensureIsArray.php ➔ ensureIsArray()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 2
nop 1
dl 0
loc 8
ccs 3
cts 3
cp 1
crap 3
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace garethp\ews\Utilities;
4
5
use garethp\ews\API\Type;
6
7
/**
8
 * @param $input
9
 * @return array
10
 */
11
function ensureIsArray($input)
12
{
13 20
    if (!is_array($input) || Type::arrayIsAssoc($input)) {
14 19
        return [$input];
15
    }
16
17 3
    return $input;
18
}
19