UnsupportedHistoricalDateException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 1
1
<?php
2
3
namespace Jarobe\HistoricalMoney\Exception;
4
5
use Money\Exception as MoneyException;
6
7
/**
8
 * Throws when a currency pair is requested for an unsupported historical date.
9
 */
10
class UnsupportedHistoricalDateException extends \InvalidArgumentException implements MoneyException
11
{
12
    /**
13
     * @param \DateTimeInterface $dateTime
14
     *
15
     * @return UnsupportedHistoricalDateException
16
     */
17
    public static function create(\DateTimeInterface $dateTime)
18
    {
19
        $message = sprintf(
20
            'No rate provided for date: %s',
21
            $dateTime->format('Y-m-d G:i:s')
22
        );
23
24
        return new self($message);
25
    }
26
}
27