diff --git a/FormatInterface.md b/FormatInterface.md new file mode 100644 index 0000000..6fa3430 --- /dev/null +++ b/FormatInterface.md @@ -0,0 +1,59 @@ +The `FormatInterface`interface defines functions that need to be implemented by all formats: + +* [setItems](#the-setitems-function) +* [display](#the-display-function) +* [stringify](#the-stringify-function) + +Find a [template](#template) at the end of this file + +#Functions + +##The `setItems` function + +The `setItems` function receives an array of items generated by the bridge and must return the object instance. Each item represents an entry in the feed. For more information refer to [BridgeAbstract](BridgeAbstract#items). + +```PHP +setItems(array $items): self +``` + +##The `display` function + +The `display` function shows the contents to the user and must return the object instance. + +```PHP +display(): self +``` + +##The `stringify` function + +The `stringify` function returns the items received by [`setItems`](#the-setitem-function) as string. + +```PHP +stringify(): string +``` + +#Template + +This is a bare minimum template for a format: + +```PHP +stringify(); + return $this; + } +} +// Imaginary empty line! +``` \ No newline at end of file