Completed
Pull Request — master (#51)
by Бабичев
07:54
created

Rate::convertTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace Bavix\Wallet\Simple;
4
5
use Bavix\Wallet\Interfaces\Rateable;
6
use Bavix\Wallet\Interfaces\Wallet;
7
8
/**
9
 * Class Rate
10
 * @package Bavix\Wallet\Simple
11
 * @codeCoverageIgnore
12
 */
13
class Rate implements Rateable
14
{
15
16
    /**
17
     * @var int
18
     */
19
    protected $amount;
20
21
    /**
22
     * @var Wallet
23
     */
24
    protected $withCurrency;
25
26
    /**
27
     * @inheritDoc
28
     */
29
    public function withAmount(int $amount): Rateable
30
    {
31
        $this->amount = $amount;
32
        return $this;
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38
    public function withCurrency(Wallet $wallet): Rateable
39
    {
40
        $this->withCurrency = $wallet;
41
        return $this;
42
    }
43
44
    /**
45
     * @inheritDoc
46
     */
47
    public function convertTo(Wallet $wallet): float
48
    {
49
        return $this->amount;
50
    }
51
52
}
53