@@ -15,37 +15,37 @@ discard block |
||
| 15 | 15 | * based on the Object Completion Criteria |
| 16 | 16 | */ |
| 17 | 17 | public static function statementForward($org_id) { |
| 18 | - $criteria = ObjectCompletionCriterion::where('org_id', $org_id)->whereHas(\Object::class, function($q){ |
|
| 18 | + $criteria = ObjectCompletionCriterion::where('org_id', $org_id)->whereHas(\Object::class, function($q) { |
|
| 19 | 19 | $q->where("completion_type", Types::XAPI); |
| 20 | 20 | })->with('object')->get(); |
| 21 | 21 | |
| 22 | - if (sizeof($criteria) === 0 ){ |
|
| 22 | + if (sizeof($criteria) === 0) { |
|
| 23 | 23 | // if there are no criteria |
| 24 | 24 | return false; |
| 25 | 25 | } else { |
| 26 | 26 | //if there is criteria |
| 27 | - $queries = []; |
|
| 27 | + $queries = [ ]; |
|
| 28 | 28 | |
| 29 | 29 | foreach ($criteria as $criterion) { |
| 30 | 30 | $course = $criterion->object->course; |
| 31 | 31 | if (empty($course) || ($course && !empty($course->deleted_at))) { |
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | - $criteriaQuery = []; |
|
| 35 | - $criteriaQuery['$comment'] = 'id:' . $criterion->id . ', object_id:' . $criterion->object_id; |
|
| 34 | + $criteriaQuery = [ ]; |
|
| 35 | + $criteriaQuery[ '$comment' ] = 'id:' . $criterion->id . ', object_id:' . $criterion->object_id; |
|
| 36 | 36 | $activity_id = $criterion->use_curatr_activity ? $criterion->object->getXapiUrl(true, true) : $criterion->activity_id; |
| 37 | - $criteriaQuery['statement.object.id'] = $activity_id; |
|
| 38 | - if (!empty($criterion->verb)) $criteriaQuery['statement.verb.id'] = $criterion->verb; |
|
| 39 | - if (!empty($criterion->completion)) $criteriaQuery['statement.result.completion'] = true; |
|
| 40 | - if (!empty($criterion->success)) $criteriaQuery['statement.result.success'] = true; |
|
| 41 | - if (is_numeric($criterion->raw)) $criteriaQuery['statement.result.score.raw'] = ['$gte' => floatval($criterion->raw)]; |
|
| 42 | - if (is_numeric($criterion->scaled)) $criteriaQuery['statement.result.score.scaled'] = ['$gte' => floatval($criterion->scaled)]; |
|
| 37 | + $criteriaQuery[ 'statement.object.id' ] = $activity_id; |
|
| 38 | + if (!empty($criterion->verb)) $criteriaQuery[ 'statement.verb.id' ] = $criterion->verb; |
|
| 39 | + if (!empty($criterion->completion)) $criteriaQuery[ 'statement.result.completion' ] = true; |
|
| 40 | + if (!empty($criterion->success)) $criteriaQuery[ 'statement.result.success' ] = true; |
|
| 41 | + if (is_numeric($criterion->raw)) $criteriaQuery[ 'statement.result.score.raw' ] = [ '$gte' => floatval($criterion->raw) ]; |
|
| 42 | + if (is_numeric($criterion->scaled)) $criteriaQuery[ 'statement.result.score.scaled' ] = [ '$gte' => floatval($criterion->scaled) ]; |
|
| 43 | 43 | |
| 44 | 44 | if (sizeof($criteriaQuery) > 0) { |
| 45 | - $queries[] = $criteriaQuery; |
|
| 45 | + $queries[ ] = $criteriaQuery; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | - if (sizeof($queries) === 0 ){ |
|
| 48 | + if (sizeof($queries) === 0) { |
|
| 49 | 49 | // if there are no quries |
| 50 | 50 | return false; |
| 51 | 51 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ], |
| 76 | 76 | ]); |
| 77 | 77 | |
| 78 | - if($request->getStatusCode() === 404) { |
|
| 78 | + if ($request->getStatusCode() === 404) { |
|
| 79 | 79 | throw new ClientException('There was a issue connecting to Learning Locker.'); |
| 80 | 80 | } |
| 81 | 81 | $response = $request->json(); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if ($this->app->runningInConsole()) { |
| 30 | 30 | $this->publishes([ |
| 31 | - __DIR__.'/../../publishable/config/laralocker.php' => config_path('laralocker.php'), |
|
| 31 | + __DIR__ . '/../../publishable/config/laralocker.php' => config_path('laralocker.php'), |
|
| 32 | 32 | ], 'config'); |
| 33 | 33 | |
| 34 | 34 | // Publishing the views. |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | // Automatically apply the package configuration |
| 67 | - $this->mergeConfigFrom(__DIR__.'/../../publishable/config/laralocker.php', 'laralocker'); |
|
| 67 | + $this->mergeConfigFrom(__DIR__ . '/../../publishable/config/laralocker.php', 'laralocker'); |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | // Register the main class to use with the facade |
| 71 | - $this->app->bind('laralocker', function () { |
|
| 71 | + $this->app->bind('laralocker', function() { |
|
| 72 | 72 | return new Laralocker; |
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | 75 | // Register the main class to use with the facade |
| 76 | - $this->app->bind('learninglocker', function () { |
|
| 76 | + $this->app->bind('learninglocker', function() { |
|
| 77 | 77 | return new LearningLocker; |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | 80 | // Register the main class to use with the facade |
| 81 | - $this->app->bind('xapi', function () { |
|
| 81 | + $this->app->bind('xapi', function() { |
|
| 82 | 82 | return new xAPI; |
| 83 | 83 | }); |
| 84 | 84 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | public function routes() |
| 441 | 441 | { |
| 442 | - require __DIR__.'/../routes/laralocker.php'; |
|
| 442 | + require __DIR__ . '/../routes/laralocker.php'; |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | /** |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | break; |
| 492 | 492 | default: |
| 493 | 493 | |
| 494 | - $message = ["error" => "Please supply a Learning Locker model", "docs" => "http://docs.learninglocker.net/"]; |
|
| 494 | + $message = [ "error" => "Please supply a Learning Locker model", "docs" => "http://docs.learninglocker.net/" ]; |
|
| 495 | 495 | |
| 496 | 496 | return $message->toJosn(); |
| 497 | 497 | } |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | class SetupClientommand extends Command |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - protected $seedersPath = __DIR__.'/../../publishable/database/seeds/'; |
|
| 18 | - protected $migrationsPath = __DIR__.'/../../publishable/database/migrations/'; |
|
| 17 | + protected $seedersPath = __DIR__ . '/../../publishable/database/seeds/'; |
|
| 18 | + protected $migrationsPath = __DIR__ . '/../../publishable/database/migrations/'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * The console command name. |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | protected function getOptions() |
| 35 | 35 | { |
| 36 | 36 | return [ |
| 37 | - ['setup', null, InputOption::VALUE_NONE, 'Add new Learning Locker® Client', null], |
|
| 37 | + [ 'setup', null, InputOption::VALUE_NONE, 'Add new Learning Locker® Client', null ], |
|
| 38 | 38 | ]; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | elseif ($this->confirm("Setup a single client with database?")): |
| 160 | 160 | |
| 161 | - if($this->confirm("Add new columns to an existing database table?")) { |
|
| 161 | + if ($this->confirm("Add new columns to an existing database table?")) { |
|
| 162 | 162 | |
| 163 | 163 | $migratedDatabaseTables = \DB::connection()->getDoctrineSchemaManager()->listTableNames(); |
| 164 | 164 | $selectedTable = $this->anticipate("Which database table?", $migratedDatabaseTables); echo "\n"; |
@@ -166,16 +166,16 @@ discard block |
||
| 166 | 166 | $tableColumns = \Schema::getColumnListing($selectedTable); |
| 167 | 167 | |
| 168 | 168 | $this->line(ucfirst($selectedTable) . " Table"); echo "\n"; |
| 169 | - $this->table($tableColumns, []); |
|
| 169 | + $this->table($tableColumns, [ ]); |
|
| 170 | 170 | |
| 171 | 171 | $keyColumn = $this->anticipate("Which column for the Learning Locker client key?", $tableColumns); echo "\n"; |
| 172 | 172 | $secretColumn = $this->anticipate("Which column for the Learning Locker client secret?", $tableColumns); echo "\n"; |
| 173 | 173 | |
| 174 | - $headers = [$keyColumn, $secretColumn]; |
|
| 174 | + $headers = [ $keyColumn, $secretColumn ]; |
|
| 175 | 175 | |
| 176 | 176 | $key = str_random(10); |
| 177 | 177 | $secret = str_random(10); |
| 178 | - $tableColumns = [$key, $secret]; |
|
| 178 | + $tableColumns = [ $key, $secret ]; |
|
| 179 | 179 | |
| 180 | 180 | $this->table($headers, $tableColumns); |
| 181 | 181 | dd($tableColumns); |
@@ -187,17 +187,17 @@ discard block |
||
| 187 | 187 | $migrationsDirectory = database_path("/migrations/*"); |
| 188 | 188 | $migrationFiles = glob($migrationsDirectory); |
| 189 | 189 | |
| 190 | - $migrationFileNames = []; |
|
| 191 | - $addColumnMigrations = []; |
|
| 190 | + $migrationFileNames = [ ]; |
|
| 191 | + $addColumnMigrations = [ ]; |
|
| 192 | 192 | |
| 193 | 193 | //Loop through the array that glob returned. |
| 194 | - foreach($migrationFiles as $migrationFile) { |
|
| 194 | + foreach ($migrationFiles as $migrationFile) { |
|
| 195 | 195 | |
| 196 | - if(strpos($migrationFile, "add_learning_locker_client_to_$table")) { |
|
| 197 | - $addColumnMigrations[] = $migrationFile; |
|
| 196 | + if (strpos($migrationFile, "add_learning_locker_client_to_$table")) { |
|
| 197 | + $addColumnMigrations[ ] = $migrationFile; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - $migrationFileNames[] = $migrationFile; |
|
| 200 | + $migrationFileNames[ ] = $migrationFile; |
|
| 201 | 201 | } |
| 202 | 202 | dd($addColumnMigrations); |
| 203 | 203 | |
@@ -216,23 +216,23 @@ discard block |
||
| 216 | 216 | break; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - if(isset($addColumnMigrations) && count($addColumnMigrations) > 1) { |
|
| 219 | + if (isset($addColumnMigrations) && count($addColumnMigrations) > 1) { |
|
| 220 | 220 | |
| 221 | 221 | $this->question(" << You have " . count($addColumnMigrations) . " migrations which will add client credential columns to the $table table "); |
| 222 | 222 | |
| 223 | - if($this->confirm("Would you like to overwrite these files with the new database migration?")) { |
|
| 223 | + if ($this->confirm("Would you like to overwrite these files with the new database migration?")) { |
|
| 224 | 224 | |
| 225 | 225 | |
| 226 | - foreach($addColumnMigrations as $addColumnMigrations) { |
|
| 227 | - if(is_file($addColumnMigrations)) |
|
| 226 | + foreach ($addColumnMigrations as $addColumnMigrations) { |
|
| 227 | + if (is_file($addColumnMigrations)) |
|
| 228 | 228 | unlink($addColumnMigrations); //delete file |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $makeMigration = $this->call("make:migration", ['name' => "add_learning_locker_client_to_$table"]); |
|
| 231 | + $makeMigration = $this->call("make:migration", [ 'name' => "add_learning_locker_client_to_$table" ]); |
|
| 232 | 232 | |
| 233 | - } elseif($this->confirm("Would you like to save the new database migration and keep existing migrations?")) { |
|
| 233 | + } elseif ($this->confirm("Would you like to save the new database migration and keep existing migrations?")) { |
|
| 234 | 234 | |
| 235 | - $makeMigration = $this->call("make:migration", ['name' => "add_learning_locker_client_to_$table"]); |
|
| 235 | + $makeMigration = $this->call("make:migration", [ 'name' => "add_learning_locker_client_to_$table" ]); |
|
| 236 | 236 | |
| 237 | 237 | } |
| 238 | 238 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $this->error(" << Client Setup Failed: Laralocker requires a Learning Locker url, client key and secret "); |
| 304 | 304 | $this->error(" << Docs: (https://docs.learninglocker.net/http-clients/) "); |
| 305 | 305 | |
| 306 | - if($this->confirm("Attempt to conigure client details?")) { |
|
| 306 | + if ($this->confirm("Attempt to conigure client details?")) { |
|
| 307 | 307 | $this->setupClient(); |
| 308 | 308 | } |
| 309 | 309 | |
@@ -351,13 +351,13 @@ discard block |
||
| 351 | 351 | $domain = $this->anticipate("What's the new learning Locker url?", [ |
| 352 | 352 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 353 | 353 | ]); |
| 354 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 354 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 355 | 355 | |
| 356 | 356 | $key = $this->ask("What's the new learning Locker client key?"); |
| 357 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 357 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 358 | 358 | |
| 359 | 359 | $secret = $this->secret("What's the new learning Locker client secret"); |
| 360 | - $this->setEnv([strtoupper(LearningLockerConstants::SECRET) => $secret]); |
|
| 360 | + $this->setEnv([ strtoupper(LearningLockerConstants::SECRET) => $secret ]); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | } else { |
@@ -370,14 +370,14 @@ discard block |
||
| 370 | 370 | $domain = $this->anticipate("What's the new learning Locker domain?", [ |
| 371 | 371 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 372 | 372 | ]); |
| 373 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 373 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 374 | 374 | } |
| 375 | 375 | break; |
| 376 | 376 | case $url_has_variable_with_no_value: |
| 377 | 377 | $domain = $this->anticipate("What's your Learning Locker url?", [ |
| 378 | 378 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 379 | 379 | ]); |
| 380 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 380 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 381 | 381 | break; |
| 382 | 382 | case $url_has_no_variable_and_no_value: |
| 383 | 383 | $domain = $this->anticipate("What's your Learning Locker url?", [ |
@@ -392,12 +392,12 @@ discard block |
||
| 392 | 392 | case $key_has_variable_and_value: |
| 393 | 393 | if ($this->confirm('Update Learning Locker client key?')) { |
| 394 | 394 | $key = $this->ask("What's the new learning Locker client key?"); |
| 395 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 395 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 396 | 396 | } |
| 397 | 397 | break; |
| 398 | 398 | case $key_has_variable_with_no_value: |
| 399 | 399 | $key = $this->ask("What's your Learning Locker client key?"); |
| 400 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 400 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 401 | 401 | break; |
| 402 | 402 | case $key_has_no_variable_and_no_value: |
| 403 | 403 | $key = $this->ask("What's your Learning Locker client key?"); |
@@ -410,12 +410,12 @@ discard block |
||
| 410 | 410 | case $secret_has_variable_and_value: |
| 411 | 411 | if ($this->confirm('Update Learning Locker client secret?')) { |
| 412 | 412 | $secret = $this->secret("What's the new learning Locker client secret"); |
| 413 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 413 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 414 | 414 | } |
| 415 | 415 | break; |
| 416 | 416 | case $secret_has_variable_with_no_value: |
| 417 | 417 | $secret = $this->secret("What's your Learning Locker client secret"); |
| 418 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $secret]); |
|
| 418 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $secret ]); |
|
| 419 | 419 | break; |
| 420 | 420 | case $secret_has_no_variable_and_no_value: |
| 421 | 421 | $secret = $this->secret("What's your Learning Locker client secret"); |
@@ -450,8 +450,8 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | protected function findComposer() |
| 452 | 452 | { |
| 453 | - if (file_exists(getcwd().'/composer.phar')) { |
|
| 454 | - return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
|
| 453 | + if (file_exists(getcwd() . '/composer.phar')) { |
|
| 454 | + return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar'; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | return 'composer'; |
@@ -472,8 +472,8 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | public function publishVendor() |
| 474 | 474 | { |
| 475 | - $tags = ['config']; |
|
| 476 | - $this->call('vendor:publish', ['--provider' => LaraLockerServiceProvider::class, '--tag' => $tags]); |
|
| 475 | + $tags = [ 'config' ]; |
|
| 476 | + $this->call('vendor:publish', [ '--provider' => LaraLockerServiceProvider::class, '--tag' => $tags ]); |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | public function checkLearningLockerConnection() |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | foreach ($variables as $variable) { |
| 522 | 522 | $env_variable = $this->getEnv($variable); |
| 523 | 523 | $contents = file_get_contents($env); |
| 524 | - $contents = str_replace(strtoupper($variable) . '=' . $env_variable, strtoupper($variable) . '=' . $data[$variable], $contents); |
|
| 524 | + $contents = str_replace(strtoupper($variable) . '=' . $env_variable, strtoupper($variable) . '=' . $data[ $variable ], $contents); |
|
| 525 | 525 | file_put_contents($env, $contents); |
| 526 | 526 | } |
| 527 | 527 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | $env_contents = $filesystem->get($env); |
| 542 | 542 | |
| 543 | 543 | if (false === strpos($env_contents, $key)) { |
| 544 | - $filesystem->append($env, "\n" . strtoupper($key) . '=' . strtolower($value)); |
|
| 544 | + $filesystem->append($env, "\n" . strtoupper($key) . '=' . strtolower($value)); |
|
| 545 | 545 | return $this->info("Created Environment variable $value successfully."); |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | const CONSOLE_ROUTE = 'console.php'; |
| 41 | 41 | const CHANNELS_ROUTE = 'channels.php'; |
| 42 | 42 | |
| 43 | - protected $seedersPath = __DIR__.'/../../publishable/database/seeds/'; |
|
| 44 | - protected $migrationsPath = __DIR__.'/../../publishable/database/migrations/'; |
|
| 43 | + protected $seedersPath = __DIR__ . '/../../publishable/database/seeds/'; |
|
| 44 | + protected $migrationsPath = __DIR__ . '/../../publishable/database/migrations/'; |
|
| 45 | 45 | |
| 46 | 46 | protected function getOptions() |
| 47 | 47 | { |
| 48 | 48 | return [ |
| 49 | - ['client', null, InputOption::VALUE_NONE, 'Setup a Learning Locker® Client', null], |
|
| 50 | - ['routes', null, InputOption::VALUE_NONE, 'Setup a Learning Locker® Endpooints', null], |
|
| 49 | + [ 'client', null, InputOption::VALUE_NONE, 'Setup a Learning Locker® Client', null ], |
|
| 50 | + [ 'routes', null, InputOption::VALUE_NONE, 'Setup a Learning Locker® Endpooints', null ], |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function setupLearningLockerClient() { |
| 135 | - return $this->call('learninglocker:client', ['--setup' => true]); |
|
| 135 | + return $this->call('learninglocker:client', [ '--setup' => true ]); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -173,13 +173,13 @@ discard block |
||
| 173 | 173 | $domain = $this->anticipate("What's the new Learning Locker® url?", [ |
| 174 | 174 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 175 | 175 | ]); |
| 176 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 176 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 177 | 177 | |
| 178 | 178 | $key = $this->ask("What's the new Learning Locker® client key?"); |
| 179 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 179 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 180 | 180 | |
| 181 | 181 | $secret = $this->secret("What's the new Learning Locker® client secret"); |
| 182 | - $this->setEnv([strtoupper(LearningLockerConstants::SECRET) => $secret]); |
|
| 182 | + $this->setEnv([ strtoupper(LearningLockerConstants::SECRET) => $secret ]); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | } else { |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | $domain = $this->anticipate("What's the new Learning Locker® domain?", [ |
| 193 | 193 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 194 | 194 | ]); |
| 195 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 195 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 196 | 196 | } |
| 197 | 197 | break; |
| 198 | 198 | case $url_has_variable_with_no_value: |
| 199 | 199 | $domain = $this->anticipate("What's your Learning Locker® url?", [ |
| 200 | 200 | 'https://saas.learninglocker.net', 'http://saas.learninglocker.net' |
| 201 | 201 | ]); |
| 202 | - $this->setEnv([strtoupper(LearningLockerConstants::URL) => $domain]); |
|
| 202 | + $this->setEnv([ strtoupper(LearningLockerConstants::URL) => $domain ]); |
|
| 203 | 203 | break; |
| 204 | 204 | case $url_has_no_variable_and_no_value: |
| 205 | 205 | $domain = $this->anticipate("What's your Learning Locker® url?", [ |
@@ -214,12 +214,12 @@ discard block |
||
| 214 | 214 | case $key_has_variable_and_value: |
| 215 | 215 | if ($this->confirm('Update Learning Locker® client key?')) { |
| 216 | 216 | $key = $this->ask("What's the new Learning Locker® client key?"); |
| 217 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 217 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 218 | 218 | } |
| 219 | 219 | break; |
| 220 | 220 | case $key_has_variable_with_no_value: |
| 221 | 221 | $key = $this->ask("What's your Learning Locker® client key?"); |
| 222 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 222 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 223 | 223 | break; |
| 224 | 224 | case $key_has_no_variable_and_no_value: |
| 225 | 225 | $key = $this->ask("What's your Learning Locker® client key?"); |
@@ -232,12 +232,12 @@ discard block |
||
| 232 | 232 | case $secret_has_variable_and_value: |
| 233 | 233 | if ($this->confirm('Update Learning Locker® client secret?')) { |
| 234 | 234 | $secret = $this->secret("What's the new Learning Locker® client secret"); |
| 235 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $key]); |
|
| 235 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $key ]); |
|
| 236 | 236 | } |
| 237 | 237 | break; |
| 238 | 238 | case $secret_has_variable_with_no_value: |
| 239 | 239 | $secret = $this->secret("What's your Learning Locker® client secret"); |
| 240 | - $this->setEnv([strtoupper(LearningLockerConstants::KEY) => $secret]); |
|
| 240 | + $this->setEnv([ strtoupper(LearningLockerConstants::KEY) => $secret ]); |
|
| 241 | 241 | break; |
| 242 | 242 | case $secret_has_no_variable_and_no_value: |
| 243 | 243 | $secret = $this->secret("What's your Learning Locker® client secret"); |
@@ -272,8 +272,8 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | protected function findComposer() |
| 274 | 274 | { |
| 275 | - if (file_exists(getcwd().'/composer.phar')) { |
|
| 276 | - return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
|
| 275 | + if (file_exists(getcwd() . '/composer.phar')) { |
|
| 276 | + return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar'; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | return 'composer'; |
@@ -295,8 +295,8 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | public function publishVendor() |
| 297 | 297 | { |
| 298 | - $tags = ['config']; |
|
| 299 | - $this->call('vendor:publish', ['--provider' => LaraLockerServiceProvider::class, '--tag' => $tags]); |
|
| 298 | + $tags = [ 'config' ]; |
|
| 299 | + $this->call('vendor:publish', [ '--provider' => LaraLockerServiceProvider::class, '--tag' => $tags ]); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | public function checkLearningLockerConnection() |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | foreach ($variables as $variable) { |
| 345 | 345 | $env_variable = $this->getEnv($variable); |
| 346 | 346 | $contents = file_get_contents($env); |
| 347 | - $contents = str_replace(strtoupper($variable) . '=' . $env_variable, strtoupper($variable) . '=' . $data[$variable], $contents); |
|
| 347 | + $contents = str_replace(strtoupper($variable) . '=' . $env_variable, strtoupper($variable) . '=' . $data[ $variable ], $contents); |
|
| 348 | 348 | file_put_contents($env, $contents); |
| 349 | 349 | } |
| 350 | 350 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $env_contents = $filesystem->get($env); |
| 365 | 365 | |
| 366 | 366 | if (false === strpos($env_contents, $key)) { |
| 367 | - $filesystem->append($env, "\n" . strtoupper($key) . '=' . strtolower($value)); |
|
| 367 | + $filesystem->append($env, "\n" . strtoupper($key) . '=' . strtolower($value)); |
|
| 368 | 368 | return $this->info("Created Environment variable $value successfully."); |
| 369 | 369 | } |
| 370 | 370 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function show($id) |
| 27 | 27 | { |
| 28 | - $select = ["_id"]; |
|
| 28 | + $select = [ "_id" ]; |
|
| 29 | 29 | return LearningLocker::client($id)->get($select); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function show($id) |
| 27 | 27 | { |
| 28 | - $selectables = ["_id"]; |
|
| 28 | + $selectables = [ "_id" ]; |
|
| 29 | 29 | return LearningLocker::store($id)->get($selectables); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @param $homepage = Account Homepage |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | - public function actor($actor = [], $ref = null, $homepage = null) |
|
| 31 | + public function actor($actor = [ ], $ref = null, $homepage = null) |
|
| 32 | 32 | { |
| 33 | 33 | if (!$actor) return error('Please supply an actor'); |
| 34 | 34 | |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if ($actor_type === xAPIConstants::MBOX) { |
| 39 | 39 | |
| 40 | - if ($actor['name'] && $actor['email']) { |
|
| 41 | - $authority = StatementGenerator::createAuthority($actor['name'], $actor['email']); |
|
| 42 | - $actor = StatementGenerator::createMboxActor($actor['name'], $actor['email']); |
|
| 40 | + if ($actor[ 'name' ] && $actor[ 'email' ]) { |
|
| 41 | + $authority = StatementGenerator::createAuthority($actor[ 'name' ], $actor[ 'email' ]); |
|
| 42 | + $actor = StatementGenerator::createMboxActor($actor[ 'name' ], $actor[ 'email' ]); |
|
| 43 | 43 | // dd($authority); |
| 44 | 44 | } else { |
| 45 | 45 | return error('Please supply the actor\'s name and email in the form of an array.'); |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | // $this->agent->setAuthority($authority); |
| 50 | - $this->agent->setName($actor['name']); |
|
| 51 | - $this->agent->setMbox($actor['mbox']); |
|
| 50 | + $this->agent->setName($actor[ 'name' ]); |
|
| 51 | + $this->agent->setMbox($actor[ 'mbox' ]); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // if ($actor_type === xAPIConstants::ACCOUNT && $actor) { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | isset($this->result) ? $this->result : null |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | - $this->make = []; |
|
| 121 | + $this->make = [ ]; |
|
| 122 | 122 | $this->make = $this->statement; |
| 123 | 123 | return $this->make; |
| 124 | 124 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ); |
| 144 | 144 | |
| 145 | 145 | // $this->send = []; |
| 146 | - $this->send =$this->send; |
|
| 146 | + $this->send = $this->send; |
|
| 147 | 147 | return $this->send; |
| 148 | 148 | |
| 149 | 149 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('xapi_verbs', function (Blueprint $table) { |
|
| 16 | + Schema::create('xapi_verbs', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigIncrements('id'); |
| 18 | 18 | $table->json('verbs'); |
| 19 | 19 | $table->timestamps(); |