mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 09:35:57 +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:
parent
2460b67886
commit
fc8421ed50
7 changed files with 32 additions and 95 deletions
|
@ -77,7 +77,9 @@ class JsonFormatTest extends TestCase {
|
|||
}
|
||||
|
||||
private function initFormat() {
|
||||
$this->format = \Format::create('Json');
|
||||
$formatFac = new FormatFactory();
|
||||
$formatFac->setWorkingDir(PATH_LIB_FORMATS);
|
||||
$this->format = $formatFac->create('Json');
|
||||
$this->format->setItems($this->sample->items);
|
||||
$this->format->setExtraInfos($this->sample->meta);
|
||||
$this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue