MetaMainSubscription::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
9
namespace Newscoop\PaywallBundle\Meta;
10
11
/**
12
 * Meta main subscription class.
13
 */
14
class MetaMainSubscription
15
{
16
    public $identifier;
17
    public $name;
18
    public $price;
19
    public $range;
20
    public $type;
21
    public $currency;
22
    public $description;
23
24
    /**
25
     * Construct.
26
     *
27
     * @param array $subscription
28
     */
29
    public function __construct(array $subscription)
30
    {
31
        $this->identifier = $subscription['id'];
32
        $this->name = $subscription['name'];
33
        $this->price = $subscription['price'];
34
        $this->ranges = $subscription['ranges'];
0 ignored issues
show
Bug introduced by
The property ranges does not seem to exist. Did you mean range?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
35
        $this->type = $subscription['type'];
36
        $this->currency = $subscription['currency'];
37
        $this->description = $subscription['description'];
38
    }
39
}
40