Completed
Push — master ( 9ba778...870b98 )
by Mauro
01:54
created

ArrayConverter::convertToObjectArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the ArrayQuery package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace ArrayQuery\Helpers;
12
13
class ArrayConverter
14
{
15
    /**
16
     * @param $array
17
     * @return mixed
18
     */
19
    public static function convertToObjectArray($array)
20
    {
21
        return json_decode(json_encode($array));
22
    }
23
24
    /**
25
     * @param $array
26
     * @return mixed
27
     */
28
    public static function convertToPlainArray($array)
29
    {
30
        return json_decode(json_encode($array), true);
31
    }
32
}
33