| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Variable |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $name; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var float |
||
| 18 | */ |
||
| 19 | protected $value; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Variable constructor. |
||
| 23 | * |
||
| 24 | * @param string $name |
||
| 25 | */ |
||
| 26 | 21 | public function __construct(string $name) |
|
| 27 | { |
||
| 28 | 21 | $this->name = $name; |
|
| 29 | 21 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @return float |
||
| 33 | */ |
||
| 34 | 18 | public function getValue(): float |
|
| 35 | { |
||
| 36 | 18 | return $this->value; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param float $value |
||
| 41 | */ |
||
| 42 | 18 | public function setValue(float $value): void |
|
| 43 | { |
||
| 44 | 18 | $this->value = $value; |
|
| 45 | 18 | } |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function getName(): string |
||
| 53 | } |
||
| 54 | } |