Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Use a more common naming convention for abstract classes
Browse files Browse the repository at this point in the history
  • Loading branch information
titouanmathis committed Jul 14, 2021
1 parent a9d8801 commit 0a16c38
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Studiometa\Repositories;

/** Class */
abstract class Repository {
abstract class AbstractRepository {
/**
* List of posts.
*
Expand Down Expand Up @@ -42,7 +42,7 @@ public function first() {
*
* @param array $params Query params.
*
* @return Repository
* @return AbstractRepository
*/
protected function query( array $params ) {
// Clear old result sets.
Expand Down Expand Up @@ -81,7 +81,7 @@ abstract protected function do_query( $params );
/**
* Clears the current result set.
*
* @return Repository
* @return AbstractRepository
*/
protected function reset() {
$this->result_set = array();
Expand All @@ -93,7 +93,7 @@ protected function reset() {
*
* @param array $result_set Result set.
*
* @return Repository
* @return AbstractRepository
*/
protected function result_set( $result_set = array() ) {
$this->result_set = $result_set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Timber\PostQuery;

/** Class */
class PostRepository extends Repository {
class PostRepository extends AbstractRepository {
const CLASS_TYPE = '\Timber\Post';
const POST_TYPES = array( 'post' ); // Main post types.

Expand All @@ -33,7 +33,7 @@ public function do_query( $params ) {
* @param array $exclude Posts to exclude (optional).
* @param integer $paged Enable pagination (optional).
*
* @return Repository
* @return AbstractRepository
*/
public function posts_by_category_slug( $slug, $limit = 10, $exclude = array(), $paged = 0 ) {

Expand Down Expand Up @@ -77,7 +77,7 @@ public function posts_by_category_slug( $slug, $limit = 10, $exclude = array(),
* @param array $exclude IDs of posts to exclude.
* @param integer $paged Enable pagination.
*
* @return Repository
* @return AbstractRepository
*/
public function latest_posts( $limit = 10, array $exclude = array(), $paged = 0 ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Timber\TermGetter;

/** Class */
final class TermRepository extends Repository {
final class TermRepository extends AbstractRepository {
const CLASS_TYPE = '\Timber\Term';

/**
Expand All @@ -30,7 +30,7 @@ public function do_query( $params ) {
* @param array $exclude IDs of posts to exclude.
* @param int $limit Number of maximum results.
*
* @return Repository
* @return AbstractRepository
*/
public function top_level_terms( $taxonomy, $exclude = array(), $limit = 100 ) {
// Set sane defaults so we don't do full table scans.
Expand Down

0 comments on commit 0a16c38

Please sign in to comment.