Code Duplication    Length = 9-9 lines in 2 locations

src/Accountant.php 2 locations

@@ 32-40 (lines=9) @@
29
     * @param Money $money2
30
     * @return Money
31
     */
32
    public function add(Money $money1, Money $money2)
33
    {
34
        $this->checkCurrenciesMatch($money1, $money2);
35
36
        return new Money(
37
            $money1->getAmount() + $money2->getAmount(),
38
            $money1->getCurrency()
39
        );
40
    }
41
42
    /**
43
     * $money1 - $money2
@@ 49-57 (lines=9) @@
46
     * @param Money $money2
47
     * @return Money
48
     */
49
    public function subtract(Money $money1, Money $money2)
50
    {
51
        $this->checkCurrenciesMatch($money1, $money2);
52
53
        return new Money(
54
            $money1->getAmount() - $money2->getAmount(),
55
            $money1->getCurrency()
56
        );
57
    }
58
59
    /**
60
     * $money * $fraction