2016-09-05 19:05:19 +03:00
|
|
|
<?php
|
2022-07-01 16:10:30 +03:00
|
|
|
|
2018-11-16 23:48:59 +03:00
|
|
|
/**
|
|
|
|
* This file is part of RSS-Bridge, a PHP project capable of generating RSS and
|
|
|
|
* Atom feeds for websites that don't have one.
|
|
|
|
*
|
|
|
|
* For the full license information, please view the UNLICENSE file distributed
|
|
|
|
* with this source code.
|
|
|
|
*
|
|
|
|
* @package Core
|
|
|
|
* @license http://unlicense.org/ UNLICENSE
|
|
|
|
* @link https://github.com/rss-bridge/rss-bridge
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The format interface
|
|
|
|
*
|
|
|
|
* @todo Add missing function to the interface
|
|
|
|
* @todo Explain parameters and return values in more detail
|
|
|
|
* @todo Return self more often (to allow call chaining)
|
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
interface FormatInterface
|
|
|
|
{
|
2018-11-16 23:48:59 +03:00
|
|
|
/**
|
|
|
|
* Generate a string representation of the current data
|
|
|
|
*
|
|
|
|
* @return string The string representation
|
|
|
|
*/
|
2016-09-10 21:41:11 +03:00
|
|
|
public function stringify();
|
2018-11-16 23:48:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set items
|
|
|
|
*
|
|
|
|
* @param array $bridges The items
|
|
|
|
* @return self The format object
|
|
|
|
*
|
|
|
|
* @todo Rename parameter `$bridges` to `$items`
|
|
|
|
*/
|
2016-09-10 21:41:11 +03:00
|
|
|
public function setItems(array $bridges);
|
2018-11-16 23:48:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return items
|
|
|
|
*
|
|
|
|
* @throws \LogicException if the items are not set
|
2022-10-16 13:03:57 +03:00
|
|
|
* @return FeedItem[] The items
|
2018-11-16 23:48:59 +03:00
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
public function getItems();
|
2018-11-16 23:48:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set extra information
|
|
|
|
*
|
|
|
|
* @param array $infos Extra information
|
|
|
|
* @return self The format object
|
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
public function setExtraInfos(array $infos);
|
2018-11-16 23:48:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return extra information
|
|
|
|
*
|
|
|
|
* @return array Extra information
|
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
public function getExtraInfos();
|
2018-11-16 23:48:59 +03:00
|
|
|
|
2019-10-31 21:00:12 +03:00
|
|
|
/**
|
|
|
|
* Return MIME type
|
|
|
|
*
|
|
|
|
* @return string The MIME type
|
|
|
|
*/
|
|
|
|
public function getMimeType();
|
|
|
|
|
2018-11-16 23:48:59 +03:00
|
|
|
/**
|
|
|
|
* Set charset
|
|
|
|
*
|
|
|
|
* @param string $charset The charset
|
|
|
|
* @return self The format object
|
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
public function setCharset($charset);
|
2018-11-16 23:48:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return current charset
|
|
|
|
*
|
|
|
|
* @return string The charset
|
|
|
|
*/
|
2016-11-07 21:58:41 +03:00
|
|
|
public function getCharset();
|
2016-09-05 19:05:19 +03:00
|
|
|
}
|