Skip to content

Commit

Permalink
Fix isssue with case sensitivity on loading ArryToXml class
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Smith authored and Stephen Smith committed Sep 13, 2016
1 parent 081aa45 commit b3e4672
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ArrayToXml.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace slightlydiff\xero;

class ArrayToXML {
class ArrayToXml {
/**
* The main function for converting to an XML document.
* Pass in a multi dimensional array and this recrusively loops through and
Expand Down Expand Up @@ -38,12 +38,12 @@ public static function toXML($data, $rootNodeName = 'ResultSet', &$xml = null) {

// if there is another array found recursively call this function
if (is_array($value)) {
$node = (ArrayToXML::isAssoc($value) || $numeric) ? $xml->addChild($key) : $xml;
$node = (ArrayToXml::isAssoc($value) || $numeric) ? $xml->addChild($key) : $xml;

// recursive call.
if ($numeric)
$key = 'anon';
ArrayToXML::toXml($value, $key, $node);
ArrayToXml::toXml($value, $key, $node);
} else {

// add single node.
Expand Down Expand Up @@ -80,7 +80,7 @@ public static function toArray($xml) {
return (string)$xml;
$arr = array();
foreach ($children as $key => $node) {
$node = ArrayToXML::toArray($node);
$node = ArrayToXml::toArray($node);

// support for 'anon' non-associative arrays
if ($key == 'anon')
Expand Down
2 changes: 1 addition & 1 deletion src/XeroApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function __call($command, $arguments) {
if (is_a($arguments[1], 'SimpleXMLElement')) {
$post_body = $arguments[1]->asXML();
} elseif (is_array($arguments[1])) {
$post_body = ArrayToXML::toXML($arguments[1], $rootNodeName = $api_command['slug']);
$post_body = ArrayToXml::toXML($arguments[1], $rootNodeName = $api_command['slug']);
}
$post_body = trim(substr($post_body, (stripos($post_body, ">") + 1)));
} else {
Expand Down

0 comments on commit b3e4672

Please sign in to comment.