Skip to content

Commit

Permalink
XML Parser refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jan 20, 2017
1 parent eea5406 commit 1a3db92
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Parser/Xml.php
Expand Up @@ -41,7 +41,7 @@ public function parse()
} catch (\Exception $e) {
throw new InvalidArgumentException($e->getMessage());
}
$schema = $this->checkSchemaData($schemaData);
$schema = $this->getSchema($schemaData);
return ['schema' => $schema];
}

Expand All @@ -58,12 +58,9 @@ public function checkFormat()
return true;
}

private function checkSchemaData($schemaData)
private function getSchema($schemaData)
{
if ($schemaData instanceof SimpleXMLElement) {
return $this->arrayWalkRecursively((array) $schemaData);
}
return [];
return $this->arrayWalkRecursively((array) $schemaData);
}

private function arrayWalkRecursively(array $schemaData)
Expand Down

0 comments on commit 1a3db92

Please sign in to comment.