Completed
Pull Request — master (#2015)
by Basil
02:29
created

PriceValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
namespace luya\web\jsonld;
4
5
/**
6
 * The price accepted.
7
 *
8
 * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
9
 *
10
 * @author Basil Suter <[email protected]>
11
 * @since 1.2.2
12
 */
13
class PriceValue extends BaseValue
14
{
15
    private $_price;
16
17
    public function __construct($price)
18
    {
19
        $this->_price = $price;
20
    }
21
22
    public function getValue()
23
    {
24
        return str_replace(",", ".", $this->_price);
25
    }
26
}
27