GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 3121b4...19602e )
by Steeven
02:46
created

DataJSON::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 3
nc 3
nop 1
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Database\DataObjects\Result\Row\Columns;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Spl\DataStructures\SplArrayObject;
19
20
/**
21
 * Class DataJSON
22
 *
23
 * @package O2System\DB\DataStructures\Row\Columns
24
 */
25
class DataJSON extends SplArrayObject
26
{
27
    /**
28
     * DataJSON::__construct
29
     *
30
     * SimpleJSONField constructor.
31
     *
32
     * @param array $data
33
     */
34
    public function __construct($data = [])
35
    {
36
        parent::__construct([]);
37
38
        if ( ! empty($data)) {
39
            foreach ($data as $key => $value) {
40
                $this->__set($key, $value);
41
            }
42
        }
43
    }
44
45
    // ------------------------------------------------------------------------
46
47
    /**
48
     * DataJSON::__set
49
     *
50
     * Magic Method __set
51
     *
52
     * @param string $index
53
     *
54
     * @param int    $value
55
     */
56
    public function __set($index, $value)
57
    {
58
        if (is_array($value)) {
0 ignored issues
show
introduced by
The condition is_array($value) is always false.
Loading history...
59
            $value = new self($value);
60
        }
61
62
        $this->offsetSet($index, $value);
63
    }
64
65
    // ------------------------------------------------------------------------
66
67
    /**
68
     * DataJSON__toArray
69
     *
70
     * Magic Method __toArray
71
     *
72
     * @return array
73
     */
74
    public function __toArray()
75
    {
76
        return $this->getArrayCopy();
77
    }
78
}