leilukin-tumbleblog/includes/interface/Feather.php

50 lines
1.2 KiB
PHP
Raw Normal View History

2024-06-20 14:10:42 +00:00
<?php
/**
* Interface: Feather
* Describes the functions required by Feather implementations.
*/
interface Feather {
/**
* Function: submit
* Handles post submitting.
*
* Returns:
* The <Post> object created.
*/
2025-01-13 09:56:01 +00:00
public function submit(
): Post;
2024-06-20 14:10:42 +00:00
/**
* Function: update
* Handles updating a post.
*/
2025-01-13 09:56:01 +00:00
public function update(
$post
): Post|false;
2024-06-20 14:10:42 +00:00
/**
* Function: title
* Returns the appropriate source to be treated as a "title" of a post.
2025-01-13 09:56:01 +00:00
* If there is no immediate solution, you may use <Post::title_from_excerpt>.
2024-06-20 14:10:42 +00:00
*/
2025-01-13 09:56:01 +00:00
public function title(
$post
): string;
2024-06-20 14:10:42 +00:00
/**
* Function: excerpt
* Returns the appropriate source, unmodified, to be used as an excerpt of a post.
*/
2025-01-13 09:56:01 +00:00
public function excerpt(
$post
): string;
2024-06-20 14:10:42 +00:00
/**
* Function: feed_content
* Returns the appropriate content for a feed.
*/
2025-01-13 09:56:01 +00:00
public function feed_content(
$post
): string;
2024-06-20 14:10:42 +00:00
}