Skip to content

Commit

Permalink
III-2586 fix coding-standards
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnswaanen committed Nov 8, 2018
1 parent 7ea6b00 commit 79b0421
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions lib/CultureFeed/Cdb/Default.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -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());
}
Expand Down
3 changes: 1 addition & 2 deletions lib/CultureFeed/Cdb/Item/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions lib/CultureFeed/Cdb/Item/Production.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 79b0421

Please sign in to comment.