fix return types of transformer functions
Some checks failed
Some checks failed
This commit is contained in:
parent
ac99300949
commit
35bd198f47
3 changed files with 9 additions and 6 deletions
|
@ -125,14 +125,14 @@ final class Events_Manager extends Event_Transformer {
|
|||
/**
|
||||
* Get the end time from the events metadata.
|
||||
*/
|
||||
public function get_end_time() {
|
||||
public function get_end_time(): ?string {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the end time from the events metadata.
|
||||
*/
|
||||
public function get_start_time() {
|
||||
public function get_start_time(): string {
|
||||
$date_string = $this->em_event->event_start_date;
|
||||
$time_string = $this->em_event->event_start_time;
|
||||
$timezone_string = $this->em_event->event_timezone;
|
||||
|
|
|
@ -97,14 +97,14 @@ final class GatherPress extends Event {
|
|||
/**
|
||||
* Get the end time from the event object.
|
||||
*/
|
||||
protected function get_end_time() {
|
||||
protected function get_end_time(): ?string {
|
||||
return $this->gp_event->get_datetime_end( 'Y-m-d\TH:i:s\Z' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the end time from the event object.
|
||||
*/
|
||||
protected function get_start_time() {
|
||||
protected function get_start_time(): string {
|
||||
return $this->gp_event->get_datetime_start( 'Y-m-d\TH:i:s\Z' );
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,10 @@ final class The_Events_Calendar extends Event {
|
|||
/**
|
||||
* Get the end time from the event object.
|
||||
*/
|
||||
protected function get_end_time() {
|
||||
protected function get_end_time(): ?string {
|
||||
if ( empty( $this->tribe_event->end_date ) ) {
|
||||
return null;
|
||||
}
|
||||
$date = date_create( $this->tribe_event->end_date, wp_timezone() );
|
||||
return \gmdate( 'Y-m-d\TH:i:s\Z', $date->getTimestamp() );
|
||||
}
|
||||
|
@ -72,7 +75,7 @@ final class The_Events_Calendar extends Event {
|
|||
/**
|
||||
* Get the end time from the event object.
|
||||
*/
|
||||
protected function get_start_time() {
|
||||
protected function get_start_time(): string {
|
||||
$date = date_create( $this->tribe_event->start_date, wp_timezone() );
|
||||
return \gmdate( 'Y-m-d\TH:i:s\Z', $date->getTimestamp() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue