ExchangeException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromCurrencies() 0 7 1
1
<?php
2
3
namespace Money;
4
5
use Currency\Currency;
6
use Money\Exception\MoneyException;
7
8
class ExchangeException extends MoneyException
9
{
10
11
    public static function createFromCurrencies(Currency $baseCurrency, Currency $counterCurrency)
12
    {
13
        return new self(
14
            sprintf(
15
                'Cannot exchange a currency pair: %s/%s',
16
                $baseCurrency->getCode(),
17
                $counterCurrency->getCode()
18
            )
19
        );
20
    }
21
}
22