Passed
Push — main ( fce709...e7b3ac )
by Miaad
02:07
created

object()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
namespace BPT;
4
5
/**
6
 * easy function for creating inline object
7
 *
8
 *  
9
 *
10
 * e.g. => object(key: 'value', key2: 1234, key3: object(bool: true));
11
 *
12
 * same as (object) ['key' => 'value', 'key2' => 1234, 'key3' => ['bool' => true]]
13
 *
14
 * @param ...$argument
15
 *
16
 * @return object
17
 */
18
function object(... $argument): object {
19
    return (object) $argument;
20
}