UpdatePackage::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 6
rs 9.4285
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher Updater Bundle.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\UpdaterBundle\Model;
16
17
use Updater\Package\Package;
18
19
/**
20
 * Update package model class.
21
 */
22
class UpdatePackage extends Package
23
{
24
    /**
25
     * Construct method for class.
26
     *
27
     * @param array $data
28
     */
29
    public function __construct(array $data = array())
30
    {
31
        foreach ($data as $key => $value) {
32
            $this->$key = $value;
33
        }
34
    }
35
36
    /**
37
     * Get property from object.
38
     *
39
     * @param string $property Property name
40
     *
41
     * @return mixed Property value
42
     */
43
    public function __get($property)
44
    {
45
        if (property_exists($this, $property)) {
46
            return $this->$property;
47
        }
48
    }
49
}
50