From 9465dd72ee45b1bacb2a52bbc374dcd167eee12d Mon Sep 17 00:00:00 2001 From: "martin.rintelen" Date: Wed, 24 Jul 2019 14:23:58 +0200 Subject: [PATCH 1/2] return version instead of array of unknown project type --- src/Version/VersionService.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Version/VersionService.php b/src/Version/VersionService.php index 8f23cf36..aa0bdbbe 100644 --- a/src/Version/VersionService.php +++ b/src/Version/VersionService.php @@ -65,12 +65,9 @@ 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() + ); } /** From ca81ef1b051b3639c0c6051df19ce6ae5fc40814 Mon Sep 17 00:00:00 2001 From: "martin.rintelen" Date: Wed, 24 Jul 2019 14:27:57 +0200 Subject: [PATCH 2/2] fix coding style advice from build --- src/Version/VersionService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Version/VersionService.php b/src/Version/VersionService.php index aa0bdbbe..f3d16da0 100644 --- a/src/Version/VersionService.php +++ b/src/Version/VersionService.php @@ -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() ); } @@ -66,7 +67,8 @@ public function get($id) $this->log->info('Result='.$ret); return $this->json_mapper->map( - json_decode($ret), new Version() + json_decode($ret), + new Version() ); } @@ -96,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() ); }