MetaMainSubscription   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
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