diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 0000000..d8c22c8 --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,18 @@ +on: push +name: Sonarqube +jobs: + sonarQubeTrigger: + name: SonarQube Trigger + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + with: + args: > + -Dsonar.branch.name=${{ github.ref_name }} + env: + SONAR_TOKEN: "0052493ad45d69d2bc55d9bd64e9f8cc9da0bec0" + SONAR_HOST_URL: "https://pmpl.cs.ui.ac.id/sonarqube" diff --git a/.gitignore b/.gitignore index 57872d0..55940e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +composer.lock \ No newline at end of file diff --git a/composer.json b/composer.json index 73501f4..4fe0935 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "autoload": { "psr-4": { "Uasoft\\Badaso\\Module\\LMSModule\\": "src/", - "Uasoft\\Badaso\\Module\\LMSModule\\Seeders": "src/seeders" + "Uasoft\\Badaso\\Module\\LMSModule\\Seeders\\": "src/seeders" } }, "autoload-dev": { diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..3aeb4b2 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=ppl2022-d-uasoft_lms_module +sonar.sources=src/ \ No newline at end of file diff --git a/src/Commands/LMSModuleSetup.php b/src/Commands/LMSModuleSetup.php index 67ac0db..d8f2f8e 100644 --- a/src/Commands/LMSModuleSetup.php +++ b/src/Commands/LMSModuleSetup.php @@ -14,7 +14,7 @@ class LMSModuleSetup extends Command { * * @var string */ - protected $name = 'badaso-lms:setup'; + protected $name = 'badaso-lms-module:setup'; /** * The console command description. @@ -74,7 +74,7 @@ protected function addBadasoEnv() { $new_env_adding = []; foreach ($env_will_adding as $key_add_env => $val_add_env) { $status_adding = true; - foreach ($arr_env_file as $key_env_file => $val_env_file) { + foreach ($arr_env_file as $val_env_file) { $val_env_file = trim($val_env_file); if (substr($val_env_file, 0, 1) != '#' && $val_env_file != '' && strstr($val_env_file, $key_add_env)) { $status_adding = false; @@ -86,7 +86,7 @@ protected function addBadasoEnv() { } } - foreach ($new_env_adding as $index_env_add => $val_env_add) { + foreach ($new_env_adding as $val_env_add) { $arr_env_file[] = $val_env_add; } @@ -105,7 +105,7 @@ protected function addLMSTablesToHiddenTables() { $config_hidden_tables = require $config_path; $tables = LMSModule::getProtectedTables(); - foreach ($tables as $key => $value) { + foreach ($tables as $value) { if (! in_array($value, $config_hidden_tables)) { array_push($config_hidden_tables, $value); } diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 5323fa0..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,20 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -}