| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public static function createFromString( string $time, ?DateTimeZone $timezone = null ): self { |
||
| 25 | if ( $timezone === null ) { |
||
| 26 | return new self( $time ); |
||
| 27 | } |
||
| 28 | $instance = new \DateTime( $time, $timezone ); |
||
| 29 | $instance->setTimezone( new DateTimeZone( self::TIMEZONE ) ); |
||
| 30 | return new self( $instance->format( DateTimeInterface::ISO8601 ) ); |
||
| 31 | } |
||
| 32 | } |