Skip to content

Commit

Permalink
Closes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
neomerx committed Jun 25, 2015
1 parent 5cc2f74 commit a0e7fb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Encoder/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private function getEncodingParameters($data, EncodingParametersInterface $param
} elseif ($parameters !== null && $parameters->getIncludePaths() !== null) {
return $parameters;
} else {
$schema = $this->container->getSchema(is_array($data) ? $data[0] : $data);
$schema = $this->container->getSchema(is_array($data) ? reset($data) : $data);
$includePaths = $schema->getIncludePaths();
$fieldSets = $parameters === null ? null : $parameters->getFieldSets();

Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function parseData($data)
} else {
if (is_array($data) === true) {
$isOriginallyArrayed = true;
$schema = $this->container->getSchema($data[0]);
$schema = $this->container->getSchema(reset($data));
} else {
$isOriginallyArrayed = false;
$schema = $this->container->getSchema($data);
Expand Down

0 comments on commit a0e7fb6

Please sign in to comment.