Completed
Push — master ( adbef1...70d1c8 )
by Narcotic
30:19 queued 26:14
created

Hash::arrayFilterRecursive()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 30

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 8.8571
c 0
b 0
f 0
ccs 0
cts 7
cp 0
cc 5
eloc 7
nc 4
nop 1
crap 30
1
<?php
2
/**
3
 * Hash class file
4
 */
5
6
namespace Graviton\DocumentBundle\Entity;
7
8
/**
9
 * Special type for hash fields
10
 *
11
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
12
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
13
 * @link     http://swisscom.ch
14
 */
15
class Hash extends \ArrayObject implements \JsonSerializable
16
{
17
18
    /**
19
     * Specify data which should be serialized to JSON
20
     *
21
     * @return object
22
     */
23
    public function jsonSerialize()
24
    {
25
        $data = $this->getArrayCopy();
26
        if (empty($data)) {
27
            return (object) [];
28
        }
29
30
        return $data;
31
    }
32
}
33