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