CurrencyMismatchException::createFromCurrencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Money\Exception;
4
5
use Currency\Currency;
6
7
class CurrencyMismatchException extends MoneyException
8
{
9
    /**
10
     * @param Currency $expected
11
     * @param Currency $actual
12
     *
13
     * @return CurrencyMismatchException
14
     */
15
    public static function createFromCurrencies(Currency $expected, Currency $actual)
16
    {
17
        return new self(
18
            sprintf(
19
                'Currency mismatch: expected %s, got %s',
20
                $expected->getCode(),
21
                $actual->getCode()
22
            )
23
        );
24
    }
25
}
26