@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | protected function auth() { |
| 53 | - return [$this->key, $this->secret]; |
|
| 53 | + return [ $this->key, $this->secret ]; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | protected function headers() { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | self::HEADERS => $this->headers() |
| 60 | 60 | ]); |
| 61 | 61 | |
| 62 | - if ( $response->getStatusCode() === 404 ) return null; |
|
| 62 | + if ($response->getStatusCode() === 404) return null; |
|
| 63 | 63 | |
| 64 | 64 | return $this->response($response); |
| 65 | 65 | } catch (ClientException $e) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | self::BODY => $this->data($data) |
| 77 | 77 | ]); |
| 78 | 78 | |
| 79 | - if ( $response->getStatusCode() === 404 ) return null; |
|
| 79 | + if ($response->getStatusCode() === 404) return null; |
|
| 80 | 80 | |
| 81 | 81 | return $this->response($response); |
| 82 | 82 | } catch (ClientException $e) { |
@@ -124,20 +124,20 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | public function select(array $selected = array(), $response) |
| 126 | 126 | { |
| 127 | - if (!is_array($selected) || !$response) { |
|
| 128 | - $error = [ "error" => "Select must be an array."]; |
|
| 127 | + if (!is_array($selected) || !$response) { |
|
| 128 | + $error = [ "error" => "Select must be an array." ]; |
|
| 129 | 129 | return json_encode($error); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if ($selected) { |
| 133 | 133 | $response = (array) json_decode($response); |
| 134 | - $items = []; |
|
| 134 | + $items = [ ]; |
|
| 135 | 135 | |
| 136 | - foreach($selected as $select) { |
|
| 136 | + foreach ($selected as $select) { |
|
| 137 | 137 | $search = array_key_exists($select, $response); |
| 138 | 138 | |
| 139 | 139 | if ($search === true) { |
| 140 | - $items[$select] = $response[$select]; |
|
| 140 | + $items[ $select ] = $response[ $select ]; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | 44 | public function url(string $id = null) { |
| 45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->download, '/'), $id ?? $id]); |
|
| 45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->download, '/'), $id ?? $id ]); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param array $selected |
| 52 | 52 | * @return object $response |
| 53 | 53 | */ |
| 54 | - public function get(array $selected = []) { |
|
| 54 | + public function get(array $selected = [ ]) { |
|
| 55 | 55 | try { |
| 56 | 56 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 57 | 57 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @return string |
| 47 | 47 | */ |
| 48 | 48 | public function url(string $id = null) { |
| 49 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id]); |
|
| 49 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id ]); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @param array $selected |
| 56 | 56 | * @return object $response |
| 57 | 57 | */ |
| 58 | - public function get(array $selected = []) { |
|
| 58 | + public function get(array $selected = [ ]) { |
|
| 59 | 59 | try { |
| 60 | 60 | } catch (Exception $e) { |
| 61 | 61 | return $e; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @return string |
| 44 | 44 | */ |
| 45 | 45 | public function url(string $id = null) { |
| 46 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->user, '/'), $id ?? $id]); |
|
| 46 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->user, '/'), $id ?? $id ]); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param array $selected |
| 53 | 53 | * @return object $response |
| 54 | 54 | */ |
| 55 | - public function get(array $selected = []) { |
|
| 55 | + public function get(array $selected = [ ]) { |
|
| 56 | 56 | try { |
| 57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 58 | 58 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | 44 | public function url(string $id = null) { |
| 45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id]); |
|
| 45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id ]); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | 44 | public function url(string $id = null) { |
| 45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->journey, '/'), $id ?? $id]); |
|
| 45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->journey, '/'), $id ?? $id ]); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | * @return string |
| 99 | 99 | */ |
| 100 | 100 | public function url(string $id = null) { |
| 101 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id]); |
|
| 101 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id ]); |
|
| 102 | 102 | } |
| 103 | 103 | /** |
| 104 | 104 | * Learning Locker: Request Persona Details |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | try { |
| 61 | 61 | |
| 62 | 62 | if (!array_key_exists('ifi', $data)) { |
| 63 | - $data = ['ifi' => $data]; |
|
| 63 | + $data = [ 'ifi' => $data ]; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if (!is_null($this->id)) { |
| 67 | - $data['persona'] = $this->id; |
|
| 67 | + $data[ 'persona' ] = $this->id; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | public function create($data = null) { |
| 85 | 85 | try { |
| 86 | 86 | if (!array_key_exists('ifi', $data)) { |
| 87 | - $data = ['ifi' => $data]; |
|
| 87 | + $data = [ 'ifi' => $data ]; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if (!is_null($this->id)) { |
| 91 | - $data['persona'] = $this->id; |
|
| 91 | + $data[ 'persona' ] = $this->id; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |