diff --git a/index.php b/index.php index b4ae384..b61a02a 100644 --- a/index.php +++ b/index.php @@ -159,13 +159,9 @@ try { // Data transformation try { $format = Format::create($format); - $format - ->setItems($bridge->getItems()) - ->setExtraInfos(array( - 'name' => $bridge->getName(), - 'uri' => $bridge->getURI(), - )) - ->display(); + $format->setItems($bridge->getItems()); + $format->setExtraInfos($bridge->getExtraInfos()); + $format->display(); } catch(Exception $e){ echo "The bridge has crashed. You should report this to the bridges maintainer"; } diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 9517099..8282beb 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -194,6 +194,13 @@ abstract class BridgeAbstract implements BridgeInterface { public function getURI(){ return static::URI; } + + public function getExtraInfos(){ + $extraInfos = array(); + $extraInfos['name']= $this->getName(); + $extraInfos['uri']= $this->getURI(); + return $extraInfos; + } public function setCache(\CacheInterface $cache){ $this->cache = $cache;