UnsupportedDateFormatException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Graze\CiffRenderer\Exception;
4
5
use \InvalidArgumentException;
6
use Graze\CiffRenderer\Exception\ExceptionInterface;
7
8
class UnsupportedDateFormatException extends InvalidArgumentException implements ExceptionInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $format;
14
15
    /**
16
     * @param string $format
17
     * @param null|Exception $previous
18
     */
19
    public function __construct($format, \Exception $previous = null)
20
    {
21
        $this->format = $format;
22
23
        $message = sprintf('Unsupported date format [%s]', $format);
24
25
        parent::__construct($message, 0, $previous);
26
    }
27
    /**
28
     * @return string
29
     */
30
    public function getFormat()
31
    {
32
        return $this->format;
33
    }
34
}
35