@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function missingId($segment) |
| 31 | 31 | { |
| 32 | - return new self('Missing segment id for '.serialize($segment->getCode())); |
|
| 32 | + return new self('Missing segment id for ' . serialize($segment->getCode())); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public static function missingSegmentBillingId($segment) |
| 41 | 41 | { |
| 42 | - return new self('Missing segment billing id for '.serialize($segment->getId())); |
|
| 42 | + return new self('Missing segment billing id for ' . serialize($segment->getId())); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public static function failed(RepositoryResponse $repositoryResponse) |
| 51 | 51 | { |
| 52 | - return new self('Failed call: '.$repositoryResponse->getError()->getError()); |
|
| 52 | + return new self('Failed call: ' . $repositoryResponse->getError()->getError()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -69,6 +69,6 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function missingIndex($missingIndex) |
| 71 | 71 | { |
| 72 | - return new self('Invalid reposnse missing: '. $missingIndex); |
|
| 72 | + return new self('Invalid reposnse missing: ' . $missingIndex); |
|
| 73 | 73 | } |
| 74 | 74 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function add(SegmentBilling $segmentBilling) |
| 78 | 78 | { |
| 79 | 79 | |
| 80 | - $compiledUrl = $this->baseUrl.'?member_id='.$segmentBilling->getMemberId(); |
|
| 80 | + $compiledUrl = $this->baseUrl . '?member_id=' . $segmentBilling->getMemberId(); |
|
| 81 | 81 | |
| 82 | 82 | $payload = [ |
| 83 | 83 | 'segment-billing-category' => $segmentBilling->toArray(), |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $stream->rewind(); |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - if (!(isset($responseContent['response']['segment-billing-category'][0]['id']))) { |
|
| 98 | + if ( ! (isset($responseContent['response']['segment-billing-category'][0]['id']))) { |
|
| 99 | 99 | throw RepositoryException::wrongFormat(serialize($responseContent)); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | public function update(SegmentBilling $segmentBilling) |
| 115 | 115 | { |
| 116 | 116 | |
| 117 | - if (!$segmentBilling->getId()) { |
|
| 117 | + if ( ! $segmentBilling->getId()) { |
|
| 118 | 118 | throw RepositoryException::missingSegmentBillingId($segmentBilling); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - $compiledUrl = $this->baseUrl.'?member_id='.$segmentBilling->getMemberId(); |
|
| 121 | + $compiledUrl = $this->baseUrl . '?member_id=' . $segmentBilling->getMemberId(); |
|
| 122 | 122 | |
| 123 | 123 | $payload = [ |
| 124 | 124 | 'segment-billing-category' => $segmentBilling->toArray(), |
@@ -140,14 +140,14 @@ discard block |
||
| 140 | 140 | public function findOneBySegmentId($memberId, $segmentId) |
| 141 | 141 | { |
| 142 | 142 | |
| 143 | - $compiledUrl = $this->baseUrl.'?member_id='.$memberId.'&segment_id='.$segmentId; |
|
| 143 | + $compiledUrl = $this->baseUrl . '?member_id=' . $memberId . '&segment_id=' . $segmentId; |
|
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | $response = $this->client->request('GET', $compiledUrl); |
| 147 | 147 | |
| 148 | 148 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 149 | 149 | |
| 150 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 150 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 151 | 151 | throw RepositoryException::failed($repositoryResponse); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | $responseContent = json_decode($stream->getContents(), true); |
| 156 | 156 | $stream->rewind(); |
| 157 | 157 | |
| 158 | - if (!$responseContent['response']['segment-billing-categories']) { |
|
| 158 | + if ( ! $responseContent['response']['segment-billing-categories']) { |
|
| 159 | 159 | return null; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if (count($responseContent['response']['segment-billing-categories']) > 1) { |
| 163 | - throw RepositoryException::genericFailed('Expected only one results. Found '.count($responseContent['response']['segment-billing-categories'])); |
|
| 163 | + throw RepositoryException::genericFailed('Expected only one results. Found ' . count($responseContent['response']['segment-billing-categories'])); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | public function findAll($memberId, $start = 0, $maxResults = 100) |
| 179 | 179 | { |
| 180 | 180 | |
| 181 | - $cacheKey = self::CACHE_NAMESPACE.sha1($memberId.$start.$maxResults); |
|
| 181 | + $cacheKey = self::CACHE_NAMESPACE . sha1($memberId . $start . $maxResults); |
|
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | if ($this->isCacheEnabled()) { |
@@ -187,14 +187,14 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $compiledUrl = $this->baseUrl.'?member_id='.$memberId.'&start_element='.$start.'&num_elements='.$maxResults; |
|
| 190 | + $compiledUrl = $this->baseUrl . '?member_id=' . $memberId . '&start_element=' . $start . '&num_elements=' . $maxResults; |
|
| 191 | 191 | |
| 192 | 192 | |
| 193 | 193 | $response = $this->client->request('GET', $compiledUrl); |
| 194 | 194 | |
| 195 | 195 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 196 | 196 | |
| 197 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 197 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 198 | 198 | throw RepositoryException::failed($repositoryResponse); |
| 199 | 199 | } |
| 200 | 200 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $result = []; |
| 207 | 207 | |
| 208 | - if (!$responseContent['response']['segment-billing-categories']) { |
|
| 208 | + if ( ! $responseContent['response']['segment-billing-categories']) { |
|
| 209 | 209 | $responseContent['response']['segment-billing-categories'] = []; |
| 210 | 210 | } |
| 211 | 211 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | public function remove($memberId, $id) |
| 230 | 230 | { |
| 231 | 231 | |
| 232 | - $compiledUrl = $this->baseUrl.'?member_id='.$memberId.'&id='.$id; |
|
| 232 | + $compiledUrl = $this->baseUrl . '?member_id=' . $memberId . '&id=' . $id; |
|
| 233 | 233 | |
| 234 | 234 | $response = $this->client->request('DELETE', $compiledUrl); |
| 235 | 235 | |