@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $object->{$this->primaryKey}; |
58 | 58 | return $newResource; |
59 | 59 | } catch (\Exception $ex) { |
60 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
60 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $this->failOnError($res); |
69 | 69 | return $this->toObject($res); |
70 | 70 | } catch (\Exception $ex) { |
71 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
71 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $this->failOnError($res); |
80 | 80 | return $this->toObject($res); |
81 | 81 | } catch (\Exception $ex) { |
82 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
82 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->failOnError($res); |
91 | 91 | return $this->toObject($res); |
92 | 92 | } catch (\Exception $ex) { |
93 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
93 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | return; |
101 | 101 | } |
102 | 102 | $message = $res->error()[0]->message === 'Requested document does not exist' ? |
103 | - 'Resource does not exist' : |
|
104 | - 'Database operation failed'; |
|
103 | + 'Resource does not exist' : 'Database operation failed'; |
|
105 | 104 | throw new RestException( |
106 | 105 | $message, |
107 | 106 | [ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } catch (DynamoDbException $ex) { |
120 | 120 | $this->throwAwsPutError($ex); |
121 | 121 | } catch (\Exception $ex) { |
122 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
122 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
123 | 123 | } |
124 | 124 | return $newResource; |
125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $res = $this->client->deleteItem($query); |
132 | 132 | return $resourceId; |
133 | 133 | } catch (\Exception $ex) { |
134 | - throw new RestException($ex->getMessage(), ['result'=>empty($res)?null:$res]); |
|
134 | + throw new RestException($ex->getMessage(), ['result'=>empty($res) ?null:$res]); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | } |