fix: Post property hook object return types

This commit is contained in:
Victor Westerlund 2026-02-22 10:51:14 +01:00
parent 1b0a9f385f
commit d725a63293
Signed by: vlw
GPG key ID: D0AD730E1057DFC6

View file

@ -98,12 +98,12 @@
public DateTimeImmutable $post_date {
get => new DateTimeImmutable($this->get(Posts::POST_DATE->value));
set (DateTimeImmutable $post_date) => $this->set(Posts::POST_DATE->value, $post_date->format(static::DATETIME_FORMAT));
set (DateTimeImmutable $post_date) => $this->set(Posts::POST_DATE->value, $post_date->format(static::DATETIME_FORMAT), $post_date);
}
public DateTimeImmutable $post_date_gmt {
get => new DateTimeImmutable($this->get(Posts::POST_DATE_GMT->value));
set (DateTimeImmutable $post_date_gmt) => $this->set(Posts::POST_DATE_GMT->value, $post_date_gmt->format(static::DATETIME_FORMAT));
set (DateTimeImmutable $post_date_gmt) => $this->set(Posts::POST_DATE_GMT->value, $post_date_gmt->format(static::DATETIME_FORMAT), $post_date_gmt);
}
public string $post_content {
@ -158,17 +158,17 @@
public DateTimeImmutable $post_modified {
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED->value));
set (DateTimeImmutable $post_modified) => $this->set(Posts::POST_MODIFIED->value, $post_modified->format(static::DATETIME_FORMAT));
set (DateTimeImmutable $post_modified) => $this->set(Posts::POST_MODIFIED->value, $post_modified->format(static::DATETIME_FORMAT), $post_modified);
}
public DateTimeImmutable $post_modified_gmt {
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED_GMT->value));
set (DateTimeImmutable $post_modified_gmt) => $this->set(Posts::POST_MODIFIED_GMT->value, $post_modified_gmt->format(static::DATETIME_FORMAT));
set (DateTimeImmutable $post_modified_gmt) => $this->set(Posts::POST_MODIFIED_GMT->value, $post_modified_gmt->format(static::DATETIME_FORMAT), $post_modified_gmt);
}
public Post|false|null $post_parent {
get => $this->get(Posts::POST_PARENT->value) !== 0 ? new self($this->get(Posts::POST_PARENT->value)) : null;
set (Post|false|null $post_parent) => $this->set(Posts::POST_PARENT->value, $post_parent ? $post_parent->id : 0);
set (Post|false|null $post_parent) => $this->set(Posts::POST_PARENT->value, $post_parent ? $post_parent->id : 0, $post_parent);
}
public string $guid {