From 79b0421f06dc6dc9f62701218d4ceeb6e1cb42e4 Mon Sep 17 00:00:00 2001 From: Stijn Swaanen Date: Thu, 8 Nov 2018 12:27:03 +0100 Subject: [PATCH] III-2586 fix coding-standards --- lib/CultureFeed/Cdb/Default.php | 6 ++---- lib/CultureFeed/Cdb/Item/Page.php | 3 +-- lib/CultureFeed/Cdb/Item/Production.php | 4 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/CultureFeed/Cdb/Default.php b/lib/CultureFeed/Cdb/Default.php index b6a86e8..978b651 100755 --- a/lib/CultureFeed/Cdb/Default.php +++ b/lib/CultureFeed/Cdb/Default.php @@ -86,7 +86,6 @@ public function addItem(CultureFeed_Cdb_Item_Base $item) $type = get_class($item); switch ($type) { - case 'CultureFeed_Cdb_Item_Actor': $this->items['actors'][] = $item; break; @@ -111,13 +110,14 @@ public function addItem(CultureFeed_Cdb_Item_Base $item) * * @param SimpleXMLElement $xmlElement * XML element from the item to parse. + * @return CultureFeed_Cdb_Item_Actor|CultureFeed_Cdb_Item_Event|CultureFeed_Cdb_Item_Production|null + * @throws CultureFeed_Cdb_ParseException */ public static function parseItem(SimpleXMLElement $xmlElement) { // Return the correct cdb item. switch ($xmlElement->getName()) { - case 'event': return CultureFeed_Cdb_Item_Event::parseFromCdbXml($xmlElement); @@ -156,9 +156,7 @@ public function __toString() $dom->appendChild($cdbElement); foreach ($this->items as $type => $itemsFromType) { - if ($itemsFromType) { - foreach ($itemsFromType as $item) { $item->appendToDOM($cdbElement, $this->getSchemaVersion()); } diff --git a/lib/CultureFeed/Cdb/Item/Page.php b/lib/CultureFeed/Cdb/Item/Page.php index 7b04fc4..951ef71 100644 --- a/lib/CultureFeed/Cdb/Item/Page.php +++ b/lib/CultureFeed/Cdb/Item/Page.php @@ -397,6 +397,7 @@ public function appendToDOM(DOMElement $element) * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement * $xmlElement) * @return CultureFeed_Cdb_Item_Page + * @throws CultureFeed_Cdb_ParseException */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { @@ -488,7 +489,6 @@ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) } if (!empty($addressElement->lat) && !empty($addressElement->lon)) { - $coordinates = $addressElement->lat . '-' . $addressElement->lon; if ($coordinates != '0.0-0.0') { $address->setGeoInformation( @@ -517,7 +517,6 @@ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) $links = array(); if (!empty($xmlElement->links)) { foreach ($xmlElement->links->children() as $link) { - $url = (string) $link; if (empty($url)) { continue; diff --git a/lib/CultureFeed/Cdb/Item/Production.php b/lib/CultureFeed/Cdb/Item/Production.php index f3aa273..04506b6 100644 --- a/lib/CultureFeed/Cdb/Item/Production.php +++ b/lib/CultureFeed/Cdb/Item/Production.php @@ -31,6 +31,7 @@ class CultureFeed_Cdb_Item_Production extends CultureFeed_Cdb_Item_Base implemen * $xmlElement) * * @return CultureFeed_Cdb_Item_Production + * @throws CultureFeed_Cdb_ParseException */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { @@ -123,9 +124,7 @@ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) // Set the related events for this production. if (!empty($xmlElement->relatedevents) && isset($xmlElement->relatedevents->id)) { - foreach ($xmlElement->relatedevents->id as $relatedItem) { - $attributes = $relatedItem->attributes(); $production->addRelation( @@ -298,7 +297,6 @@ public function appendToDOM(DOMElement $element, $cdbScheme = '3.2') } if (!empty($this->relations)) { - $relationsElement = $dom->createElement('eventrelations'); foreach ($this->relations as $relation) {