mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +02:00
format: Refactor format factory to non-static class
The format factory can be based on the abstract factory class if it wasn't static. This allows for higher abstraction and makes future extensions possible. Also, not all parts of RSS-Bridge need to work on the same instance of the factory. References #1001
This commit is contained in:
@@ -77,7 +77,9 @@ class AtomFormatTest extends TestCase {
|
||||
}
|
||||
|
||||
private function initFormat() {
|
||||
$this->format = \Format::create('Atom');
|
||||
$formatFac = new FormatFactory();
|
||||
$formatFac->setWorkingDir(PATH_LIB_FORMATS);
|
||||
$this->format = $formatFac->create('Atom');
|
||||
$this->format->setItems($this->sample->items);
|
||||
$this->format->setExtraInfos($this->sample->meta);
|
||||
$this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC'));
|
||||
|
Reference in New Issue
Block a user