[BridgeAbstract] lighter getExtraInfos and getCachable

This commit is contained in:
Badet Aurélien 2016-12-04 14:23:01 +01:00 committed by GitHub
parent 1dbf8b2360
commit 4e2591b56a

View File

@ -8,8 +8,7 @@ abstract class BridgeAbstract implements BridgeInterface {
const MAINTAINER = 'No maintainer'; const MAINTAINER = 'No maintainer';
const CACHE_TIMEOUT = 3600; const CACHE_TIMEOUT = 3600;
const PARAMETERS = array(); const PARAMETERS = array();
const FORMATS = array(); // array of compatibles formats or null
protected $cache; protected $cache;
protected $extraInfos; protected $extraInfos;
protected $items = array(); protected $items = array();
@ -21,10 +20,7 @@ abstract class BridgeAbstract implements BridgeInterface {
* @return mixed * @return mixed
*/ */
public function getCachable(){ public function getCachable(){
$cachable = array(); return array("items" => $this->getItems(), "extraInfos" => $this->getExtraInfos());
$cachable["items"] = $this->getItems();
$cachable["extraInfos"] = $this->getExtraInfos();
return $cachable;
} }
/** /**
@ -212,10 +208,7 @@ abstract class BridgeAbstract implements BridgeInterface {
} }
public function getExtraInfos(){ public function getExtraInfos(){
$extraInfos = array(); return array("name" => $this->getName(), "uri" => $this->getURI());
$extraInfos['name']= $this->getName();
$extraInfos['uri']= $this->getURI();
return $extraInfos;
} }
public function setCache(\CacheInterface $cache){ public function setCache(\CacheInterface $cache){