Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
DateWithTimezone
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getDateFormat
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isStrictFormat
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\DateValueObjects;
3
4use Apie\DateValueObjects\Concerns\CanCreateInstanceFromDateTimeObject;
5use Apie\DateValueObjects\Concerns\CanHaveDayIntervals;
6use Apie\DateValueObjects\Concerns\CanHaveMonthIntervals;
7use Apie\DateValueObjects\Concerns\CanHaveTimeIntervals;
8use Apie\DateValueObjects\Concerns\CanHaveTimezone;
9use Apie\DateValueObjects\Concerns\CanHaveYearIntervals;
10use Apie\DateValueObjects\Concerns\IsDateValueObject;
11use Apie\DateValueObjects\Interfaces\WorksWithDays;
12use Apie\DateValueObjects\Interfaces\WorksWithMonths;
13use Apie\DateValueObjects\Interfaces\WorksWithTimeIntervals;
14use Apie\DateValueObjects\Interfaces\WorksWithYears;
15use DateTime;
16
17/**
18 * Represents a full date + time + timezone. It outputs the date as a string in ATOM format.
19 *
20 * Example '2005-08-15T15:52:01+00:00'
21 */
22final class DateWithTimezone implements WorksWithDays, WorksWithMonths, WorksWithYears, WorksWithTimeIntervals
23{
24    use CanCreateInstanceFromDateTimeObject;
25    use CanHaveDayIntervals;
26    use CanHaveMonthIntervals;
27    use CanHaveTimeIntervals;
28    use CanHaveTimezone;
29    use CanHaveYearIntervals;
30    use IsDateValueObject;
31
32    public static function getDateFormat(): string
33    {
34        return DateTime::ATOM;
35    }
36
37    protected function isStrictFormat(): bool
38    {
39        return true;
40    }
41}