@@ -56,7 +56,9 @@ |
||
| 56 | 56 | try { |
| 57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 58 | 58 | |
| 59 | - if ($selected) $response = $this->select($selected, $response); |
|
| 59 | + if ($selected) { |
|
| 60 | + $response = $this->select($selected, $response); |
|
| 61 | + } |
|
| 60 | 62 | |
| 61 | 63 | return $response; |
| 62 | 64 | } catch (Exception $e) { |
@@ -46,7 +46,9 @@ discard block |
||
| 46 | 46 | public function forwarding(string $id = null) |
| 47 | 47 | { |
| 48 | 48 | $statement_forwarding = new ForwardingHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 49 | - if ($statement_forwarding) return $statement_forwarding; |
|
| 49 | + if ($statement_forwarding) { |
|
| 50 | + return $statement_forwarding; |
|
| 51 | + } |
|
| 50 | 52 | |
| 51 | 53 | return self::statementForwarding($id ? $id : null); |
| 52 | 54 | } |
@@ -71,7 +73,9 @@ discard block |
||
| 71 | 73 | try { |
| 72 | 74 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 73 | 75 | |
| 74 | - if ($selected) $response = $this->select($selected, $response); |
|
| 76 | + if ($selected) { |
|
| 77 | + $response = $this->select($selected, $response); |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | return $response; |
| 77 | 81 | } catch (Exception $e) { |
@@ -59,7 +59,9 @@ discard block |
||
| 59 | 59 | self::HEADERS => $this->headers() |
| 60 | 60 | ]); |
| 61 | 61 | |
| 62 | - if ( $response->getStatusCode() === 404 ) return null; |
|
| 62 | + if ( $response->getStatusCode() === 404 ) { |
|
| 63 | + return null; |
|
| 64 | + } |
|
| 63 | 65 | |
| 64 | 66 | return $this->response($response); |
| 65 | 67 | } catch (ClientException $e) { |
@@ -76,7 +78,9 @@ discard block |
||
| 76 | 78 | self::BODY => $this->data($data) |
| 77 | 79 | ]); |
| 78 | 80 | |
| 79 | - if ( $response->getStatusCode() === 404 ) return null; |
|
| 81 | + if ( $response->getStatusCode() === 404 ) { |
|
| 82 | + return null; |
|
| 83 | + } |
|
| 80 | 84 | |
| 81 | 85 | return $this->response($response); |
| 82 | 86 | } catch (ClientException $e) { |
@@ -92,7 +96,9 @@ discard block |
||
| 92 | 96 | self::HEADERS => $this->headers() |
| 93 | 97 | ]); |
| 94 | 98 | |
| 95 | - if ($response->getStatusCode() === 404) return null; |
|
| 99 | + if ($response->getStatusCode() === 404) { |
|
| 100 | + return null; |
|
| 101 | + } |
|
| 96 | 102 | |
| 97 | 103 | return $this->response($response); |
| 98 | 104 | } catch (ClientException $e) { |
@@ -54,7 +54,9 @@ |
||
| 54 | 54 | public function progress(string $id = null) |
| 55 | 55 | { |
| 56 | 56 | $progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 57 | - if ($progress) return $progress; |
|
| 57 | + if ($progress) { |
|
| 58 | + return $progress; |
|
| 59 | + } |
|
| 58 | 60 | |
| 59 | 61 | return self::progress($id ? $id : null); |
| 60 | 62 | } |
@@ -43,7 +43,9 @@ discard block |
||
| 43 | 43 | public function identifier(string $id = null) |
| 44 | 44 | { |
| 45 | 45 | $identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 46 | - if ($identifier) return $identifier; |
|
| 46 | + if ($identifier) { |
|
| 47 | + return $identifier; |
|
| 48 | + } |
|
| 47 | 49 | |
| 48 | 50 | return self::identifier($id ? $id : null); |
| 49 | 51 | } |
@@ -57,7 +59,9 @@ discard block |
||
| 57 | 59 | public function attributes(string $id = null) |
| 58 | 60 | { |
| 59 | 61 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 60 | - if ($attribute) return $attribute; |
|
| 62 | + if ($attribute) { |
|
| 63 | + return $attribute; |
|
| 64 | + } |
|
| 61 | 65 | |
| 62 | 66 | return self::attribute($id ? $id : null); |
| 63 | 67 | } |
@@ -71,7 +75,9 @@ discard block |
||
| 71 | 75 | public function attribute(string $id = null) |
| 72 | 76 | { |
| 73 | 77 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 74 | - if ($attribute) return $attribute; |
|
| 78 | + if ($attribute) { |
|
| 79 | + return $attribute; |
|
| 80 | + } |
|
| 75 | 81 | |
| 76 | 82 | return self::attribute($id ? $id : null); |
| 77 | 83 | } |
@@ -85,7 +91,9 @@ discard block |
||
| 85 | 91 | public function import(string $id = null) |
| 86 | 92 | { |
| 87 | 93 | $import = new ImportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 88 | - if ($import) return $import; |
|
| 94 | + if ($import) { |
|
| 95 | + return $import; |
|
| 96 | + } |
|
| 89 | 97 | |
| 90 | 98 | return self::import($id ? $id : null); |
| 91 | 99 | } |
@@ -51,7 +51,9 @@ discard block |
||
| 51 | 51 | public function connect(string $key, string $secret, string $url) |
| 52 | 52 | { |
| 53 | 53 | $connection = new LearningLocker($key, $secret, $url); |
| 54 | - if ($connection) return $connection; |
|
| 54 | + if ($connection) { |
|
| 55 | + return $connection; |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | return self::connect($key, $secret, $url); |
| 57 | 59 | } |
@@ -65,7 +67,9 @@ discard block |
||
| 65 | 67 | public function clients(string $id = null) |
| 66 | 68 | { |
| 67 | 69 | $clients = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 68 | - if ($clients) return $clients; |
|
| 70 | + if ($clients) { |
|
| 71 | + return $clients; |
|
| 72 | + } |
|
| 69 | 73 | |
| 70 | 74 | return self::clients($id ? $id : null); |
| 71 | 75 | } |
@@ -79,7 +83,9 @@ discard block |
||
| 79 | 83 | public function client(string $id = null) |
| 80 | 84 | { |
| 81 | 85 | $client = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 82 | - if ($client) return $client; |
|
| 86 | + if ($client) { |
|
| 87 | + return $client; |
|
| 88 | + } |
|
| 83 | 89 | |
| 84 | 90 | return self::client($id ? $id : null); |
| 85 | 91 | } |
@@ -93,7 +99,9 @@ discard block |
||
| 93 | 99 | public function users(string $id = null) |
| 94 | 100 | { |
| 95 | 101 | $users = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 96 | - if ($users) return $users; |
|
| 102 | + if ($users) { |
|
| 103 | + return $users; |
|
| 104 | + } |
|
| 97 | 105 | |
| 98 | 106 | return self::users($id ? $id : null); |
| 99 | 107 | } |
@@ -107,7 +115,9 @@ discard block |
||
| 107 | 115 | public function user(string $id = null) |
| 108 | 116 | { |
| 109 | 117 | $user = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 110 | - if ($user) return $user; |
|
| 118 | + if ($user) { |
|
| 119 | + return $user; |
|
| 120 | + } |
|
| 111 | 121 | |
| 112 | 122 | return self::user($id ? $id : null); |
| 113 | 123 | } |
@@ -121,7 +131,9 @@ discard block |
||
| 121 | 131 | public function roles(string $id = null) |
| 122 | 132 | { |
| 123 | 133 | $roles = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 124 | - if ($roles) return $roles; |
|
| 134 | + if ($roles) { |
|
| 135 | + return $roles; |
|
| 136 | + } |
|
| 125 | 137 | |
| 126 | 138 | return self::roles($id ? $id : null); |
| 127 | 139 | } |
@@ -135,7 +147,9 @@ discard block |
||
| 135 | 147 | public function role(string $id = null) |
| 136 | 148 | { |
| 137 | 149 | $role = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 138 | - if ($role) return $role; |
|
| 150 | + if ($role) { |
|
| 151 | + return $role; |
|
| 152 | + } |
|
| 139 | 153 | |
| 140 | 154 | return self::role($id ? $id : null); |
| 141 | 155 | } |
@@ -149,7 +163,9 @@ discard block |
||
| 149 | 163 | public function stores(string $id = null) |
| 150 | 164 | { |
| 151 | 165 | $stores = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 152 | - if ($stores) return $stores; |
|
| 166 | + if ($stores) { |
|
| 167 | + return $stores; |
|
| 168 | + } |
|
| 153 | 169 | |
| 154 | 170 | return self::stores($id ? $id : null); |
| 155 | 171 | } |
@@ -163,7 +179,9 @@ discard block |
||
| 163 | 179 | public function store(string $id = null) |
| 164 | 180 | { |
| 165 | 181 | $store = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 166 | - if ($store) return $store; |
|
| 182 | + if ($store) { |
|
| 183 | + return $store; |
|
| 184 | + } |
|
| 167 | 185 | |
| 168 | 186 | return self::store($id ? $id : null); |
| 169 | 187 | } |
@@ -177,7 +195,9 @@ discard block |
||
| 177 | 195 | public function queries(string $id = null) |
| 178 | 196 | { |
| 179 | 197 | $queries = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 180 | - if ($queries) return $queries; |
|
| 198 | + if ($queries) { |
|
| 199 | + return $queries; |
|
| 200 | + } |
|
| 181 | 201 | |
| 182 | 202 | return self::queries($id ? $id : null); |
| 183 | 203 | } |
@@ -191,7 +211,9 @@ discard block |
||
| 191 | 211 | public function query(string $id = null) |
| 192 | 212 | { |
| 193 | 213 | $query = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 194 | - if ($query) return $query; |
|
| 214 | + if ($query) { |
|
| 215 | + return $query; |
|
| 216 | + } |
|
| 195 | 217 | |
| 196 | 218 | return self::query($id ? $id : null); |
| 197 | 219 | } |
@@ -205,7 +227,9 @@ discard block |
||
| 205 | 227 | public function exports(string $id = null) |
| 206 | 228 | { |
| 207 | 229 | $exports = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 208 | - if ($exports) return $exports; |
|
| 230 | + if ($exports) { |
|
| 231 | + return $exports; |
|
| 232 | + } |
|
| 209 | 233 | |
| 210 | 234 | return self::exports($id ? $id : null); |
| 211 | 235 | } |
@@ -219,7 +243,9 @@ discard block |
||
| 219 | 243 | public function export(string $id = null) |
| 220 | 244 | { |
| 221 | 245 | $export = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 222 | - if ($export) return $export; |
|
| 246 | + if ($export) { |
|
| 247 | + return $export; |
|
| 248 | + } |
|
| 223 | 249 | |
| 224 | 250 | return self::export($id ? $id : null); |
| 225 | 251 | } |
@@ -233,7 +259,9 @@ discard block |
||
| 233 | 259 | public function personas(string $id = null) |
| 234 | 260 | { |
| 235 | 261 | $personas = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 236 | - if ($personas) return $personas; |
|
| 262 | + if ($personas) { |
|
| 263 | + return $personas; |
|
| 264 | + } |
|
| 237 | 265 | |
| 238 | 266 | return self::personas($id ? $id : null); |
| 239 | 267 | } |
@@ -247,7 +275,9 @@ discard block |
||
| 247 | 275 | public function persona(string $id = null) |
| 248 | 276 | { |
| 249 | 277 | $persona = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 250 | - if ($persona) return $persona; |
|
| 278 | + if ($persona) { |
|
| 279 | + return $persona; |
|
| 280 | + } |
|
| 251 | 281 | |
| 252 | 282 | return self::persona($id ? $id : null); |
| 253 | 283 | } |
@@ -261,7 +291,9 @@ discard block |
||
| 261 | 291 | public function personaAttribute(string $id = null) |
| 262 | 292 | { |
| 263 | 293 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 264 | - if ($persona_attribute) return $persona_attribute; |
|
| 294 | + if ($persona_attribute) { |
|
| 295 | + return $persona_attribute; |
|
| 296 | + } |
|
| 265 | 297 | |
| 266 | 298 | return self::persona($id ? $id : null); |
| 267 | 299 | } |
@@ -275,7 +307,9 @@ discard block |
||
| 275 | 307 | public function personaAttributes(string $id = null) |
| 276 | 308 | { |
| 277 | 309 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 278 | - if ($persona_attribute) return $persona_attribute; |
|
| 310 | + if ($persona_attribute) { |
|
| 311 | + return $persona_attribute; |
|
| 312 | + } |
|
| 279 | 313 | |
| 280 | 314 | return self::persona($id ? $id : null); |
| 281 | 315 | } |
@@ -289,7 +323,9 @@ discard block |
||
| 289 | 323 | public function personaIdentifier(string $id = null) |
| 290 | 324 | { |
| 291 | 325 | $persona_identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 292 | - if ($persona_identifier) return $persona_identifier; |
|
| 326 | + if ($persona_identifier) { |
|
| 327 | + return $persona_identifier; |
|
| 328 | + } |
|
| 293 | 329 | |
| 294 | 330 | return self::personaIdentifier($id ? $id : null); |
| 295 | 331 | } |
@@ -303,7 +339,9 @@ discard block |
||
| 303 | 339 | public function journeys(string $id = null) |
| 304 | 340 | { |
| 305 | 341 | $journeys = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 306 | - if ($journeys) return $journeys; |
|
| 342 | + if ($journeys) { |
|
| 343 | + return $journeys; |
|
| 344 | + } |
|
| 307 | 345 | |
| 308 | 346 | return self::journeys($id ? $id : null); |
| 309 | 347 | } |
@@ -317,7 +355,9 @@ discard block |
||
| 317 | 355 | public function journey(string $id = null) |
| 318 | 356 | { |
| 319 | 357 | $journey = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 320 | - if ($journey) return $journey; |
|
| 358 | + if ($journey) { |
|
| 359 | + return $journey; |
|
| 360 | + } |
|
| 321 | 361 | |
| 322 | 362 | return self::journey($id ? $id : null); |
| 323 | 363 | } |
@@ -331,7 +371,9 @@ discard block |
||
| 331 | 371 | public function journeyProgress(string $id = null) |
| 332 | 372 | { |
| 333 | 373 | $journey_progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 334 | - if ($journey_progress) return $journey_progress; |
|
| 374 | + if ($journey_progress) { |
|
| 375 | + return $journey_progress; |
|
| 376 | + } |
|
| 335 | 377 | |
| 336 | 378 | return self::journeyProgress($id ? $id : null); |
| 337 | 379 | } |
@@ -345,7 +387,9 @@ discard block |
||
| 345 | 387 | public function dashboards(string $id = null) |
| 346 | 388 | { |
| 347 | 389 | $dashboards = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 348 | - if ($dashboards) return $dashboards; |
|
| 390 | + if ($dashboards) { |
|
| 391 | + return $dashboards; |
|
| 392 | + } |
|
| 349 | 393 | |
| 350 | 394 | return self::dashboards($id ? $id : null); |
| 351 | 395 | } |
@@ -359,7 +403,9 @@ discard block |
||
| 359 | 403 | public function dashboard(string $id = null) |
| 360 | 404 | { |
| 361 | 405 | $dashboard = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 362 | - if ($dashboard) return $dashboard; |
|
| 406 | + if ($dashboard) { |
|
| 407 | + return $dashboard; |
|
| 408 | + } |
|
| 363 | 409 | |
| 364 | 410 | return self::dashboard($id ? $id : null); |
| 365 | 411 | } |
@@ -373,7 +419,9 @@ discard block |
||
| 373 | 419 | public function downloads(string $id = null) |
| 374 | 420 | { |
| 375 | 421 | $downloads = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 376 | - if ($downloads) return $downloads; |
|
| 422 | + if ($downloads) { |
|
| 423 | + return $downloads; |
|
| 424 | + } |
|
| 377 | 425 | |
| 378 | 426 | return self::downloads($id ? $id : null); |
| 379 | 427 | } |
@@ -387,7 +435,9 @@ discard block |
||
| 387 | 435 | public function download(string $id = null) |
| 388 | 436 | { |
| 389 | 437 | $download = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 390 | - if ($download) return $download; |
|
| 438 | + if ($download) { |
|
| 439 | + return $download; |
|
| 440 | + } |
|
| 391 | 441 | |
| 392 | 442 | return self::download($id ? $id : null); |
| 393 | 443 | } |
@@ -401,7 +451,9 @@ discard block |
||
| 401 | 451 | public function statements(string $id = null) |
| 402 | 452 | { |
| 403 | 453 | $statements = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 404 | - if ($statements) return $statements; |
|
| 454 | + if ($statements) { |
|
| 455 | + return $statements; |
|
| 456 | + } |
|
| 405 | 457 | |
| 406 | 458 | return self::statements($id ? $id : null); |
| 407 | 459 | } |
@@ -415,7 +467,9 @@ discard block |
||
| 415 | 467 | public function statement(string $id = null) |
| 416 | 468 | { |
| 417 | 469 | $statement = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 418 | - if ($statement) return $statement; |
|
| 470 | + if ($statement) { |
|
| 471 | + return $statement; |
|
| 472 | + } |
|
| 419 | 473 | |
| 420 | 474 | return self::statement($id ? $id : null); |
| 421 | 475 | } |
@@ -429,7 +483,9 @@ discard block |
||
| 429 | 483 | public function statementForwarding(string $id = null) |
| 430 | 484 | { |
| 431 | 485 | $statement_forwarding = new ForwardingHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 432 | - if ($statement_forwarding) return $statement_forwarding; |
|
| 486 | + if ($statement_forwarding) { |
|
| 487 | + return $statement_forwarding; |
|
| 488 | + } |
|
| 433 | 489 | |
| 434 | 490 | return self::statementForwarding($id ? $id : null); |
| 435 | 491 | } |
@@ -443,7 +499,9 @@ discard block |
||
| 443 | 499 | public function organisations(string $id = null) |
| 444 | 500 | { |
| 445 | 501 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 446 | - if ($organisation) return $organisation; |
|
| 502 | + if ($organisation) { |
|
| 503 | + return $organisation; |
|
| 504 | + } |
|
| 447 | 505 | |
| 448 | 506 | return self::organisation($id ? $id : null); |
| 449 | 507 | } |
@@ -457,7 +515,9 @@ discard block |
||
| 457 | 515 | public function organisation(string $id = null) |
| 458 | 516 | { |
| 459 | 517 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 460 | - if ($organisation) return $organisation; |
|
| 518 | + if ($organisation) { |
|
| 519 | + return $organisation; |
|
| 520 | + } |
|
| 461 | 521 | |
| 462 | 522 | return self::organisation($id ? $id : null); |
| 463 | 523 | } |
@@ -471,7 +531,9 @@ discard block |
||
| 471 | 531 | public function visualisations(string $id = null) |
| 472 | 532 | { |
| 473 | 533 | $visualisations = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 474 | - if ($visualisations) return $visualisations; |
|
| 534 | + if ($visualisations) { |
|
| 535 | + return $visualisations; |
|
| 536 | + } |
|
| 475 | 537 | |
| 476 | 538 | return self::visualisations($id ? $id : null); |
| 477 | 539 | } |
@@ -485,7 +547,9 @@ discard block |
||
| 485 | 547 | public function visualisation(string $id = null) |
| 486 | 548 | { |
| 487 | 549 | $visualisation = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
| 488 | - if ($visualisation) return $visualisation; |
|
| 550 | + if ($visualisation) { |
|
| 551 | + return $visualisation; |
|
| 552 | + } |
|
| 489 | 553 | |
| 490 | 554 | return self::visualisation($id ? $id : null); |
| 491 | 555 | } |
@@ -56,7 +56,9 @@ |
||
| 56 | 56 | try { |
| 57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 58 | 58 | |
| 59 | - if ($selected) $response = $this->select($selected, $response); |
|
| 59 | + if ($selected) { |
|
| 60 | + $response = $this->select($selected, $response); |
|
| 61 | + } |
|
| 60 | 62 | |
| 61 | 63 | return $response; |
| 62 | 64 | } catch (Exception $e) { |
@@ -56,7 +56,9 @@ |
||
| 56 | 56 | try { |
| 57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 58 | 58 | |
| 59 | - if ($selected) $response = $this->select($selected, $response); |
|
| 59 | + if ($selected) { |
|
| 60 | + $response = $this->select($selected, $response); |
|
| 61 | + } |
|
| 60 | 62 | |
| 61 | 63 | return $response; |
| 62 | 64 | } catch (Exception $e) { |
@@ -56,7 +56,9 @@ |
||
| 56 | 56 | try { |
| 57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
| 58 | 58 | |
| 59 | - if ($selected) $response = $this->select($selected, $response); |
|
| 59 | + if ($selected) { |
|
| 60 | + $response = $this->select($selected, $response); |
|
| 61 | + } |
|
| 60 | 62 | |
| 61 | 63 | return $response; |
| 62 | 64 | } catch (Exception $e) { |