mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 23:57:29 +02:00
[core] Rename item getter/setter
getDatas -> getItems setDatas -> setItems Note: Bridge->setDatas actually sets data, where Bridge->getItems only returns items (this is why Bridge->setDatas was not changed)
This commit is contained in:
@@ -139,7 +139,7 @@ abstract class BridgeAbstract implements BridgeInterface {
|
||||
* Return items stored in the bridge
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDatas(){
|
||||
public function getItems(){
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ abstract class BridgeAbstract implements BridgeInterface {
|
||||
|
||||
$this->collectData();
|
||||
if(!is_null($this->cache)){
|
||||
$this->cache->saveData($this->getDatas());
|
||||
$this->cache->saveData($this->getItems());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ abstract class BridgeAbstract implements BridgeInterface {
|
||||
$this->collectData();
|
||||
|
||||
if(!is_null($this->cache)){
|
||||
$this->cache->saveData($this->getDatas());
|
||||
$this->cache->saveData($this->getItems());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
interface FormatInterface{
|
||||
public function stringify();
|
||||
public function display();
|
||||
public function setDatas(array $bridge);
|
||||
public function setItems(array $bridges);
|
||||
}
|
||||
|
||||
abstract class FormatAbstract implements FormatInterface{
|
||||
@@ -48,15 +48,14 @@ abstract class FormatAbstract implements FormatInterface{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDatas(array $datas){
|
||||
public function setItems(array $datas){
|
||||
$this->datas = $datas;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDatas(){
|
||||
public function getItems(){
|
||||
if( !is_array($this->datas) ){
|
||||
throw new \LogicException('Feed the ' . get_class($this) . ' with "setDatas" method before !');
|
||||
throw new \LogicException('Feed the ' . get_class($this) . ' with "setItems" method before !');
|
||||
}
|
||||
|
||||
return $this->datas;
|
||||
|
@@ -32,7 +32,7 @@ require_once $vendorLibSimpleHtmlDom;
|
||||
Format::setDir(__DIR__ . '/formats/');
|
||||
$format = Format::create('Atom');
|
||||
$format
|
||||
->setDatas($bridge->getDatas())
|
||||
->setItems($bridge->getItems())
|
||||
->setExtraInfos(array(
|
||||
'name' => $bridge->getName(),
|
||||
'uri' => $bridge->getURI(),
|
||||
|
Reference in New Issue
Block a user