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

ArrayConverter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A convertToPlainArray() 0 3 1
A convertToObjectArray() 0 3 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