Skip to content

Commit

Permalink
Merge pull request #260 from reinfi/issue-259
Browse files Browse the repository at this point in the history
return version instead of array of unknown project type
  • Loading branch information
lesstif authored Jul 29, 2019
2 parents 6463884 + ca81ef1 commit e2a9f15
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Version/VersionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public function create($version)
$ret = $this->exec($this->uri, $data, 'POST');

return $this->json_mapper->map(
json_decode($ret), new Version()
json_decode($ret),
new Version()
);
}

Expand Down Expand Up @@ -65,12 +66,10 @@ public function get($id)

$this->log->info('Result='.$ret);

$json = json_decode($ret);
$results = array_map(function ($elem) {
return $this->json_mapper->map($elem, new ProjectType());
}, $json);

return $results;
return $this->json_mapper->map(
json_decode($ret),
new Version()
);
}

/**
Expand Down Expand Up @@ -99,7 +98,8 @@ public function update(Version $version)
$ret = $this->exec($this->uri.'/'.$version->id, $data, 'PUT');

return $this->json_mapper->map(
json_decode($ret), new Version()
json_decode($ret),
new Version()
);
}

Expand Down

0 comments on commit e2a9f15

Please sign in to comment.