@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function add(Segment $segment) |
56 | 56 | { |
57 | 57 | |
58 | - $compiledUrl = self::BASE_URL.$segment->getMemberId(); |
|
58 | + $compiledUrl = self::BASE_URL . $segment->getMemberId(); |
|
59 | 59 | |
60 | 60 | $payload = [ |
61 | 61 | 'segment' => $segment->toArray(), |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $responseContent = json_decode($stream->getContents(), true); |
72 | 72 | $stream->rewind(); |
73 | 73 | |
74 | - if (!(isset($responseContent['response']['segment']['id']))) { |
|
74 | + if ( ! (isset($responseContent['response']['segment']['id']))) { |
|
75 | 75 | throw RepositoryException::wrongFormat(serialize($responseContent)); |
76 | 76 | } |
77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public function remove($id, $memberId) |
92 | 92 | { |
93 | 93 | |
94 | - $compiledUrl = self::BASE_URL.$memberId.'/'.$id; |
|
94 | + $compiledUrl = self::BASE_URL . $memberId . '/' . $id; |
|
95 | 95 | |
96 | 96 | $response = $this->client->request('DELETE', $compiledUrl); |
97 | 97 | |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | public function update(Segment $segment) |
111 | 111 | { |
112 | 112 | |
113 | - if (!$segment->getId()) { |
|
113 | + if ( ! $segment->getId()) { |
|
114 | 114 | throw new \Exception('name me - missing id'); |
115 | 115 | } |
116 | 116 | |
117 | - $compiledUrl = self::BASE_URL.$segment->getMemberId().'/'.$segment->getId(); |
|
117 | + $compiledUrl = self::BASE_URL . $segment->getMemberId() . '/' . $segment->getId(); |
|
118 | 118 | |
119 | 119 | $payload = [ |
120 | 120 | 'segment' => $segment->toArray(), |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | public function findOneById($id, $memberId) |
138 | 138 | { |
139 | 139 | |
140 | - $compiledUrl = self::BASE_URL.$memberId.'/'.$id; |
|
140 | + $compiledUrl = self::BASE_URL . $memberId . '/' . $id; |
|
141 | 141 | |
142 | 142 | $response = $this->client->request('GET', $compiledUrl); |
143 | 143 | |
144 | 144 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
145 | 145 | |
146 | - if (!$repositoryResponse->isSuccessful()) { |
|
146 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
147 | 147 | return null; |
148 | 148 | } |
149 | 149 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function findAll($memberId, $start = 0, $maxResults = 100) |
166 | 166 | { |
167 | 167 | |
168 | - $cacheKey = self::CACHE_NAMESPACE.sha1($memberId.$start.$maxResults); |
|
168 | + $cacheKey = self::CACHE_NAMESPACE . sha1($memberId . $start . $maxResults); |
|
169 | 169 | |
170 | 170 | if ($this->isCacheEnabled()) { |
171 | 171 | if ($this->cache->contains($cacheKey)) { |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - $compiledUrl = self::BASE_URL.$memberId."?start_element=$start&num_elements=$maxResults"; |
|
176 | + $compiledUrl = self::BASE_URL . $memberId . "?start_element=$start&num_elements=$maxResults"; |
|
177 | 177 | |
178 | 178 | $response = $this->client->request('GET', $compiledUrl); |
179 | 179 | |
180 | 180 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
181 | 181 | |
182 | - if (!$repositoryResponse->isSuccessful()) { |
|
182 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
183 | 183 | return null; |
184 | 184 | } |
185 | 185 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
74 | 74 | |
75 | - if (!$repositoryResponse->isSuccessful()) { |
|
75 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
76 | 76 | throw new \Exception('name me - not success'); |
77 | 77 | } |
78 | 78 | |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | public function getUploadTicket($memberId) |
90 | 90 | { |
91 | 91 | |
92 | - $compiledUrl = self::BASE_URL.'?member_id='.$memberId; |
|
92 | + $compiledUrl = self::BASE_URL . '?member_id=' . $memberId; |
|
93 | 93 | |
94 | 94 | $response = $this->client->request('POST', $compiledUrl); |
95 | 95 | |
96 | 96 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
97 | 97 | |
98 | - if (!$repositoryResponse->isSuccessful()) { |
|
98 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
99 | 99 | throw new \Exception('name me - not success'); |
100 | 100 | } |
101 | 101 | |
102 | - if (!isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'])) { |
|
102 | + if ( ! isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'])) { |
|
103 | 103 | throw new \Exception('name me - not index'); |
104 | 104 | } |
105 | 105 | |
@@ -120,17 +120,17 @@ discard block |
||
120 | 120 | public function getJobStatus(UploadTicket $uploadJob) |
121 | 121 | { |
122 | 122 | |
123 | - $compiledUrl = self::BASE_URL."?member_id={$uploadJob->getMemberId()}&job_id={$uploadJob->getJobId()}"; |
|
123 | + $compiledUrl = self::BASE_URL . "?member_id={$uploadJob->getMemberId()}&job_id={$uploadJob->getJobId()}"; |
|
124 | 124 | |
125 | 125 | $response = $this->client->request('GET', $compiledUrl); |
126 | 126 | |
127 | 127 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
128 | 128 | |
129 | - if (!$repositoryResponse->isSuccessful()) { |
|
129 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
130 | 130 | throw new \Exception('name me - not success'); |
131 | 131 | } |
132 | 132 | |
133 | - if (!isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
133 | + if ( ! isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
134 | 134 | throw new \Exception('name me - not index'); |
135 | 135 | } |
136 | 136 |