Skip to content

Commit

Permalink
[fix] Replace self:: calls with static:: for extensible abstract …
Browse files Browse the repository at this point in the history
…class
  • Loading branch information
AndreasMaros committed Jan 31, 2022
1 parent f2451ab commit 4a1b8cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Domain/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected static function getAllFromDB(): array {
$posts = static::getPosts();

foreach($posts as $post) {
$entity = self::entityFromPostId($post->ID, $post);
$entity = static::entityFromPostId($post->ID, $post);

$result[$post->ID] = [
'item' => $entity,
Expand Down Expand Up @@ -183,7 +183,7 @@ protected function getById(?int $postId, &$isDirty = null): ?StorableEntity
$isDirty = false;

try {
$entity = self::entityFromPostId($postId);
$entity = static::entityFromPostId($postId);
$this->entities[$postId] = [
'item' => $entity,
'dirty' => false,
Expand Down Expand Up @@ -225,7 +225,7 @@ protected static function entityFromPostId(int $postId, WP_Post $post = null): S
$post = get_post($postId);
}

$meta = self::getMetaValues($postId);
$meta = static::getMetaValues($postId);

return new static::$entityClass($post, $meta);
}
Expand All @@ -237,6 +237,6 @@ protected static function entityFromPostId(int $postId, WP_Post $post = null): S
*/
protected function persist(StorableEntity $item): void
{
update_post_meta($item->getPostId(), self::$metaKey, $item->toMetaValues());
update_post_meta($item->getPostId(), static::$metaKey, $item->toMetaValues());
}
}

0 comments on commit 4a1b8cf

Please sign in to comment.