Files
peptide-repo-core/includes/core/class-pr-core-related-posts-provider.php
peptiderepo 665d7fa9e1 Adopt reusable CI standard + PHPUnit conversion (#22)
Squash-merge of PR #22: adopt shared reusable CI workflow, convert PHPUnit to stubs, update branch-protection contexts.

QA-approved at 05d8094a1d. All required CI checks green.

Agent-Session: 2026-06-17-prcore-ci-deploy
2026-06-17 01:12:00 +07:00

37 lines
998 B
PHP

<?php
/**
* Related Posts Provider.
*
* @package Peptide_Repo_Core
*/
declare(strict_types=1);
/**
* Interface defining the get_posts() contract for related-post providers
*
* @package Peptide_Repo_Core
*/
/**
* Contract for any provider that retrieves posts related to a peptide.
*
* What: Interface defining the get_posts() contract for related-post providers.
* Who calls it: PR_Core_Related_Posts_Section accepts any implementation.
* Dependencies: None.
*
* @see includes/core/class-pr-core-internal-posts-provider.php — default implementation.
* @see includes/core/class-pr-core-related-posts-section.php — consumer.
*/
interface PR_Core_Related_Posts_Provider {
/**
* Get posts related to a peptide.
*
* @param int $peptide_id The peptide post ID.
* @param int $limit Maximum number of posts to return.
* @return array<int, \WP_Post> Array of WP_Post objects (may be empty).
*/
public function get_posts( int $peptide_id, int $limit ): array;
}