Snapshot::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 6
rs 9.2
cc 4
eloc 4
nc 8
nop 1
1
<?php
2
/**
3
 * This file is part of the Totem package
4
 *
5
 * For the full copyright and license information, please view the LICENSE file
6
 * that was distributed with this source code.
7
 *
8
 * @copyright Baptiste Clavié <[email protected]>
9
 * @license   http://www.opensource.org/licenses/MIT-License MIT License
10
 */
11
12
namespace Totem;
13
14
class Snapshot extends AbstractSnapshot
15
{
16
    public function __construct(array $args = [])
17
    {
18
        $this->raw = isset($args['raw']) ? $args['raw'] : null;
19
        $this->data = isset($args['data']) ? $args['data'] : [];
20
        $this->comparable = isset($args['comparable']) ? true === $args['comparable'] : null;
21
    }
22
23
    public function isComparable(AbstractSnapshot $s)
24
    {
25
        return null === $this->comparable ? parent::isComparable($s) : $this->comparable;
26
    }
27
}
28
29