From 4e2591b56a069557baf726966c32517e624d202c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Badet=20Aur=C3=A9lien?= Date: Sun, 4 Dec 2016 14:23:01 +0100 Subject: [PATCH] [BridgeAbstract] lighter getExtraInfos and getCachable --- lib/BridgeAbstract.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 7c885bce..6194d3d9 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -8,8 +8,7 @@ abstract class BridgeAbstract implements BridgeInterface { const MAINTAINER = 'No maintainer'; const CACHE_TIMEOUT = 3600; const PARAMETERS = array(); - const FORMATS = array(); // array of compatibles formats or null - + protected $cache; protected $extraInfos; protected $items = array(); @@ -21,10 +20,7 @@ abstract class BridgeAbstract implements BridgeInterface { * @return mixed */ public function getCachable(){ - $cachable = array(); - $cachable["items"] = $this->getItems(); - $cachable["extraInfos"] = $this->getExtraInfos(); - return $cachable; + return array("items" => $this->getItems(), "extraInfos" => $this->getExtraInfos()); } /** @@ -212,10 +208,7 @@ abstract class BridgeAbstract implements BridgeInterface { } public function getExtraInfos(){ - $extraInfos = array(); - $extraInfos['name']= $this->getName(); - $extraInfos['uri']= $this->getURI(); - return $extraInfos; + return array("name" => $this->getName(), "uri" => $this->getURI()); } public function setCache(\CacheInterface $cache){