@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @param mixed $response |
|
47 | + * @param string $response |
|
48 | 48 | */ |
49 | 49 | public function setResponse($response) |
50 | 50 | { |
@@ -105,7 +105,7 @@ |
||
105 | 105 | $self->setSuccessful($responseArray['response']['status'] == self::STATUS_SUCCESS); |
106 | 106 | } |
107 | 107 | |
108 | - if (!$self->isSuccessful()) { |
|
108 | + if ( ! $self->isSuccessful()) { |
|
109 | 109 | $error = Error::fromArray($responseArray['response']); |
110 | 110 | } |
111 | 111 |
@@ -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($memberId, $id) |
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($memberId, $id) |
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 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function findAll($memberId, $start = 0, $maxResults = 100) |
167 | 167 | { |
168 | 168 | |
169 | - $cacheKey = self::CACHE_NAMESPACE.sha1($memberId.$start.$maxResults); |
|
169 | + $cacheKey = self::CACHE_NAMESPACE . sha1($memberId . $start . $maxResults); |
|
170 | 170 | |
171 | 171 | if ($this->isCacheEnabled()) { |
172 | 172 | if ($this->cache->contains($cacheKey)) { |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - $compiledUrl = self::BASE_URL.$memberId."?start_element=$start&num_elements=$maxResults"; |
|
177 | + $compiledUrl = self::BASE_URL . $memberId . "?start_element=$start&num_elements=$maxResults"; |
|
178 | 178 | |
179 | 179 | $response = $this->client->request('GET', $compiledUrl); |
180 | 180 | |
181 | 181 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
182 | 182 | |
183 | - if (!$repositoryResponse->isSuccessful()) { |
|
183 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
184 | 184 | return null; |
185 | 185 | } |
186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | $result = []; |
192 | 192 | |
193 | - if (!$responseContent['response']['segments']) { |
|
193 | + if ( ! $responseContent['response']['segments']) { |
|
194 | 194 | throw new \Exception('name me -missing index'); |
195 | 195 | } |
196 | 196 |
@@ -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()) { |
|
99 | - throw new \Exception('name me - not success'. $repositoryResponse->getError()->getError()); |
|
98 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
99 | + throw new \Exception('name me - not success' . $repositoryResponse->getError()->getError()); |
|
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 $uploadTicket) |
121 | 121 | { |
122 | 122 | |
123 | - $compiledUrl = self::BASE_URL."?member_id={$uploadTicket->getMemberId()}&job_id={$uploadTicket->getJobId()}"; |
|
123 | + $compiledUrl = self::BASE_URL . "?member_id={$uploadTicket->getMemberId()}&job_id={$uploadTicket->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()) { |
|
130 | - throw new \Exception('name me - not success'. $repositoryResponse->getError()->getError()); |
|
129 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
130 | + throw new \Exception('name me - not success' . $repositoryResponse->getError()->getError()); |
|
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 |