| Total Complexity | 5 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class ComposedCalendar implements CalendarInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Formatter |
||
| 19 | * |
||
| 20 | * @var FormatterInterface |
||
| 21 | */ |
||
| 22 | protected $formatter; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Parser |
||
| 26 | * |
||
| 27 | * @var ParserInterface |
||
| 28 | */ |
||
| 29 | protected $parser; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Class constructor. |
||
| 33 | * |
||
| 34 | * @param FormatterInterface $formatter |
||
| 35 | * @param ParserInterface $parser |
||
| 36 | */ |
||
| 37 | public function __construct(FormatterInterface $formatter, ParserInterface $parser) |
||
| 38 | { |
||
| 39 | $this->formatter = $formatter; |
||
| 40 | $this->parser = $parser; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @inheritDoc |
||
| 45 | */ |
||
| 46 | public function format(DateTimeInterface $input, $format) |
||
| 47 | { |
||
| 48 | return $this->formatter->format($input, $format); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @inheritDoc |
||
| 53 | */ |
||
| 54 | public function formatDateRepresentation(DateRepresentationInterface $input, $format) |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @inheritDoc |
||
| 61 | */ |
||
| 62 | public function parse($input, $format, DateTimeZone $timezone = null) |
||
| 63 | { |
||
| 64 | return $this->parser->parse($input, $format, $timezone); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @inheritDoc |
||
| 69 | */ |
||
| 70 | public function parseToDateRepresentation($input, $format, DateTimeZone $timezone = null) |
||
| 73 | } |
||
| 74 | } |
||
| 75 |