@@ -116,7 +116,7 @@ |
||
| 116 | 116 | /** |
| 117 | 117 | * @param UploadTicket $uploadTicket |
| 118 | 118 | * |
| 119 | - * @return UploadJob $uploadJob |
|
| 119 | + * @return UploadJobStatus $uploadJob |
|
| 120 | 120 | * @throws \Exception |
| 121 | 121 | */ |
| 122 | 122 | public function getJobStatus(UploadTicket $uploadTicket) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 76 | 76 | |
| 77 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 77 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 78 | 78 | throw UploadException::failed($repositoryResponse); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | public function getUploadTicket($memberId) |
| 92 | 92 | { |
| 93 | 93 | |
| 94 | - $compiledUrl = self::BASE_URL.'?member_id='.$memberId; |
|
| 94 | + $compiledUrl = self::BASE_URL . '?member_id=' . $memberId; |
|
| 95 | 95 | |
| 96 | 96 | $response = $this->client->request('POST', $compiledUrl); |
| 97 | 97 | |
| 98 | 98 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 99 | 99 | |
| 100 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 100 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 101 | 101 | throw UploadException::failed($repositoryResponse); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (!isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'])) { |
|
| 104 | + if ( ! isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'])) { |
|
| 105 | 105 | throw UploadException::missingIndex('response->batch_segment_upload_job'); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -122,17 +122,17 @@ discard block |
||
| 122 | 122 | public function getJobStatus(UploadTicket $uploadTicket) |
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - $compiledUrl = self::BASE_URL."?member_id={$uploadTicket->getMemberId()}&job_id={$uploadTicket->getJobId()}"; |
|
| 125 | + $compiledUrl = self::BASE_URL . "?member_id={$uploadTicket->getMemberId()}&job_id={$uploadTicket->getJobId()}"; |
|
| 126 | 126 | |
| 127 | 127 | $response = $this->client->request('GET', $compiledUrl); |
| 128 | 128 | |
| 129 | 129 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 130 | 130 | |
| 131 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 131 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 132 | 132 | throw UploadException::failed($repositoryResponse); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if (!isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
| 135 | + if ( ! isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
| 136 | 136 | throw UploadException::missingIndex('response->batch_segment_upload_job->0'); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -156,17 +156,17 @@ discard block |
||
| 156 | 156 | public function getUploadHistory($memberId, $start = 0, $maxResults = 100) |
| 157 | 157 | { |
| 158 | 158 | |
| 159 | - $compiledUrl = self::BASE_URL."?member_id=$memberId&start_element=$start&num_elements=$maxResults"; |
|
| 159 | + $compiledUrl = self::BASE_URL . "?member_id=$memberId&start_element=$start&num_elements=$maxResults"; |
|
| 160 | 160 | |
| 161 | 161 | $response = $this->client->request('GET', $compiledUrl); |
| 162 | 162 | |
| 163 | 163 | $repositoryResponse = RepositoryResponse::fromResponse($response); |
| 164 | 164 | |
| 165 | - if (!$repositoryResponse->isSuccessful()) { |
|
| 165 | + if ( ! $repositoryResponse->isSuccessful()) { |
|
| 166 | 166 | throw UploadException::failed($repositoryResponse); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if (!isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
| 169 | + if ( ! isset($repositoryResponse->getResponseAsArray()['response']['batch_segment_upload_job'][0])) { |
|
| 170 | 170 | throw UploadException::missingIndex('response->batch_segment_upload_job->0'); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function authenticate($username, $password, $cache = true) |
| 46 | 46 | { |
| 47 | 47 | |
| 48 | - $cacheKey = self::CACHE_NAMESPACE.sha1($username.$password.self::BASE_URL); |
|
| 48 | + $cacheKey = self::CACHE_NAMESPACE . sha1($username . $password . self::BASE_URL); |
|
| 49 | 49 | |
| 50 | 50 | if ($cache) { |
| 51 | 51 | if ($this->cache->contains($cacheKey)) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $contentArray = json_decode($content, true); |
| 69 | 69 | |
| 70 | - if (!isset($contentArray["response"]["token"])) { |
|
| 70 | + if ( ! isset($contentArray["response"]["token"])) { |
|
| 71 | 71 | throw new AuthException($content); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function authenticate($username, $password, $cache = true) |
| 46 | 46 | { |
| 47 | 47 | |
| 48 | - $cacheKey = self::CACHE_NAMESPACE.sha1($username.$password.self::BASE_URL); |
|
| 48 | + $cacheKey = self::CACHE_NAMESPACE . sha1($username . $password . self::BASE_URL); |
|
| 49 | 49 | |
| 50 | 50 | if ($cache) { |
| 51 | 51 | if ($this->cache->contains($cacheKey)) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $contentArray = json_decode($content, true); |
| 69 | 69 | |
| 70 | - if (!isset($contentArray["response"]["token"])) { |
|
| 70 | + if ( ! isset($contentArray["response"]["token"])) { |
|
| 71 | 71 | throw new AuthException($content); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public static function missingId(Segment $segment) |
| 30 | 30 | { |
| 31 | - return new self('Missing segment id for '.serialize($segment->getCode())); |
|
| 31 | + return new self('Missing segment id for ' . serialize($segment->getCode())); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public static function failed(RepositoryResponse $repositoryResponse) |
| 40 | 40 | { |
| 41 | - return new self('Failed call: '.$repositoryResponse->getError()->getError()); |
|
| 41 | + return new self('Failed call: ' . $repositoryResponse->getError()->getError()); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /**+ |
@@ -48,6 +48,6 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public static function missingIndex($missingIndex) |
| 50 | 50 | { |
| 51 | - return new self('Invalid reposnse missing: '. $missingIndex); |
|
| 51 | + return new self('Invalid reposnse missing: ' . $missingIndex); |
|
| 52 | 52 | } |
| 53 | 53 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public static function failed(RepositoryResponse $repositoryResponse) |
| 19 | 19 | { |
| 20 | - return new self('Failed call: '.$repositoryResponse->getError()->getError()); |
|
| 20 | + return new self('Failed call: ' . $repositoryResponse->getError()->getError()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /**+ |
@@ -27,6 +27,6 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public static function missingIndex($missingIndex) |
| 29 | 29 | { |
| 30 | - return new self('Invalid reposnse missing: '. $missingIndex); |
|
| 30 | + return new self('Invalid reposnse missing: ' . $missingIndex); |
|
| 31 | 31 | } |
| 32 | 32 | } |